(X)HTML, JavaScript, DHTML, XML, CSS Client scripting tehnologije, Dynamic HTML, Cascading Stylesheets, XML i standardi |
|
Alati teme | Način prikaza |
|
04. 01. 2014. | #1 |
profesionalac
Professional
Datum učlanjenja: 25.10.2012
Poruke: 278
Hvala: 16
32 "Hvala" u 9 poruka
|
Mene angular odusevljava jer pogledajte sam koliko je redova potrebno za sta bi sa jquerijem bilo potrebno puno vise rada:
Kôd:
<!doctype html> <html ng-app> <head> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script> <script> function UsersCtrl($scope) { $scope.users = [ { firstName: "Camila", lastName: "Gilson" }, { firstName: "Chloe", lastName: "Creighton" }, { firstName: "Zoey", lastName: "White" }, { firstName: "Claire", lastName: "Campbell" }, { firstName: "Kylie", lastName: "Smith" }, { firstName: "Charlotte", lastName: "Gilson" } ]; $scope.title = 'User list'; } </script> </head> <body> <div ng-controller="UsersCtrl"> <h1>{{title}}</h1> Search: <input ng-model="search"> <ul> <li ng-repeat="user in users | filter:search"> {{user.firstName}} {{user.lastName}} </li> </ul> </div> </body> </html> |
05. 01. 2014. | #2 |
profesionalac
Professional
Datum učlanjenja: 25.10.2012
Poruke: 278
Hvala: 16
32 "Hvala" u 9 poruka
|
http://jsfiddle.net/3ggeJ/4/ angular + bootstrap
|
|
|