[ Launch: Three Circles Setup ] c6a6d74703906368d8df by alatzl[ Launch: Three Circles Answer ] 6258892 by lewis500[ Launch: Three Circles Answer ] 5565405 by lewis500
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
| // Instead of this: | |
| angular.module('app', []) | |
| .controller('MyCtrl', function($scope) { | |
| // What is moment? How do I know this exists and is the right object? | |
| $scope.startTime = moment(); | |
| $scope.endTime - moment().add(1, 'h'); | |
| }); | |
| // Try this: | |
| angular.module('app', []) |
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
| // Instead of using $.ajax for an API call... | |
| angular.module('app', []) | |
| .factory('addressBook', function() { | |
| var data = null; | |
| return { | |
| getAddresses: function() { | |
| $.ajax({ | |
| url: '/path/to/data', | |
| dataType: 'json', |
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
| // Instead of this: | |
| angular.module('petStoreApp', []) | |
| .controller('petStoreOneCtrl', function($scope) { | |
| $scope.myCat = { | |
| name: 'Grumpy', | |
| type: 'cat' | |
| }; | |
| $scope.myDog = { | |
| name: 'Lassie', | |
| type: 'dog' |
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
| // An example showing two services that are nearly identical | |
| angular.module('petStoreApp', []) | |
| .service('catService', function($http) { | |
| var svc = { | |
| getList: function() { // get a list of all cats | |
| $http({ method: 'GET', url: 'cats/all' }) | |
| .then(successFn, errorFn); | |
| }, | |
| getInfo: function(catId) { // get info about a specific cat | |
| $http({ method: 'GET', url: 'cats/' + catId }) |
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
| // Base service | |
| angular.module('petStoreApp', []) | |
| .service('petService', function($http) { | |
| var petSvc = function(_endpoint_) { | |
| var endpoint = _endpoint_ + '/'; | |
| return { | |
| getList: getList, | |
| getInfo: getInfo | |
| }; |
[ Launch: Gradient Bars Setup ] e10f4790474b0a269a8a by alatzl[ Launch: Gradient Bars ] 6258888 by lewis500[ Launch: Gradient Bars ] 5565447 by lewis500
[ Launch: Three Circles Setup ] fa065de546d6df931b9c by alatzl[ Launch: Three Circles Setup ] c6a6d74703906368d8df by alatzl[ Launch: Three Circles Answer ] 6258892 by lewis500[ Launch: Three Circles Answer ] 5565405 by lewis500
I hereby claim:
- I am alatzl on github.
- I am aatzl (https://keybase.io/aatzl) on keybase.
- I have a public key ASDP5Aana-GMM26wQUOxcaV4XNBBrN-SzHVI5DMVFN1PTQo
To claim this, I am signing this object:
OlderNewer