3 category: JavaScript libraries
6 <html ng-app="nameApp">
11 <ul ng-controller="MyListCtrl">
12 <li ng-repeat="phone in phones">
21 <select ng-model="orderProp">
22 <option value="name">Alphabetical</option>
23 <option value="age">Newest</option>
29 App = angular.module('myApp', []);
31 App.controller('MyListCtrl', function ($scope) {
32 $scope.phones = [ ... ];
36 ### Controller with protection from minification
38 App.controller('Name', [
41 function ($scope, $http) {
54 App.service('NameService', function($http){
57 return $http.get(url);
62 In controller you call with parameter and will use promises to return data from server.
65 App.controller('controllerName',
66 function(NameService){
74 App.directive('name', function(){
76 template: '<h1>Hello</h1>'
81 In HTML will use `<name></name>` to render your template `<h1>Hello</h1>`
85 App.controller('PhoneListCtrl', function ($scope, $http) {
86 $http.get('/data.json').success(function (data) {
93 * https://github.com/angular/angular-seed
94 * https://angularjs.org/