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:
I hereby claim:
To claim this, I am signing this object:
[ 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
[ Launch: Gradient Bars Setup ] e10f4790474b0a269a8a by alatzl[ Launch: Gradient Bars ] 6258888 by lewis500[ Launch: Gradient Bars ] 5565447 by lewis500
[ Launch: Three Circles Setup ] c6a6d74703906368d8df by alatzl[ Launch: Three Circles Answer ] 6258892 by lewis500[ Launch: Three Circles Answer ] 5565405 by lewis500
// Base service | |
angular.module('petStoreApp', []) | |
.service('petService', function($http) { | |
var petSvc = function(_endpoint_) { | |
var endpoint = _endpoint_ + '/'; | |
return { | |
getList: getList, | |
getInfo: getInfo | |
}; |
// 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 }) |
// Instead of this: | |
angular.module('petStoreApp', []) | |
.controller('petStoreOneCtrl', function($scope) { | |
$scope.myCat = { | |
name: 'Grumpy', | |
type: 'cat' | |
}; | |
$scope.myDog = { | |
name: 'Lassie', | |
type: 'dog' |
// 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', |
// 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', []) |
angular.module('myModule') | |
.directive('roar', function() { | |
return { | |
restrict: 'E', | |
scope: {}, | |
controller: roarCtrl, | |
controllerAs: dinoRoar, | |
bindToController: { | |
dinoType: '@' | |
} |