This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular.module(‘myModule’) | |
| .directive(‘datePicker’, function(){ […] }) ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <ul> | |
| <li ng-repeat="todo in todos | limitTo:-1:1"> | |
| <!-- Affichage du contenu du tableau todos à partir du second élément (begin=1) --> | |
| <!-- le paramètre limit=-1 indique que nous désirons afficher tout le reste du contenu du tableau --> | |
| </li> | |
| </ul> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <input type="text" ng-model="firstName" /> | |
| <input type="text" data-ng-model="firstName" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular.module('module') | |
| .factory('MyFactory', function(){ | |
| return { | |
| method: function(){}; | |
| }; | |
| }); | |
| angular.module('module') | |
| .service('MyFactory', function(){ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div ng-class="{true:'close', false: 'open'}[isCollapsed()]"> | |
| </div> | |
| <div ng-class="{'close': isCollapsed()}"> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $http.get('/api/users', {cache:true}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <p>{{'key' | translate}}</p> | |
| <p translate="key"></p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "env": { | |
| "browser": true, | |
| "node": false | |
| }, | |
| "rules": { | |
| "comma-dangle": [1, "always"], | |
| "no-comma-dangle": 0, | |
| "handle-callback-err": 0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular.module('application').controller('DemoCtrl', function($scope, $q){ | |
| function sendHttpRequest(){ | |
| //Comme je n'ai pas de serveur, je ne peux pas attaquer directement l'API | |
| //return $http.get('/api') | |
| //Pour y remédier, je vais créer ma propre promesse grâce au service $q | |
| var deferred = $q.defer() | |
| //L'appel à la méthode resolve va resoudre, de manière la synchrone, la promesse qui vient d'être créée | |
| deferred.resolve({data: {'from': 'server'}}); | |
| return deferred.promise; |