angular.module('myModule', [])
.factory('serviceId', ['depService', function(depService) {
// ...
}])
.directive('directiveName', ['depService', function(depService) {
// ...
}])
.filter('filterName', ['depService', function(depService) {
// ...
}]);
@reference_1_angularjs.org
app.factory('<service>', ['$http', function(http) {
var shinyNewServiceInstance;
return shinyNewServiceInstance;
}]);
@reference_2_stackoverflow
Create custom service in AngularJS
No comments:
Post a Comment