Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
angular.module('NoteApp', ['ngRoute']) | |
.config(['$routeProvider', function($routeProvider) { | |
$routeProvider.when('/notes', { | |
templateUrl: 'templates/pages/notes/index.html' | |
}) | |
.when('/users', { | |
templateUrl: 'templates/pages/users/index.html' | |
}) | |
.when('/notes/new', { | |
templateUrl: 'templates/pages/notes/edit.html' |
angular.module("<ModuleName>").factory("<ServiceName>", function <ServiceName>Factory() { | |
return { <object containing shared functions> } | |
}); |
// The $get function is where you return an object and inject services | |
// Providers run before everything else, so the only thing you can inject into them is other providers | |
angular.module("<ModuleName>").provider("<ServiceName>", function <ServiceName>Provider(otherProvider) { | |
this.$get <factory function> | |
}); |