Got the answer (or at least understanding) from the book Green and Seshadri AngularJS.
The angular.module operator works in two modes: configuration and startup. The 'ngResource' statement works fine with the configuration:
angular.module ('a3App', ['ngResource']). config (function ($ routeProvider) {
$ routeProvider
.when ('/', {
templateUrl: 'views / main.html',
controller: 'MainCtrl'
})
.otherwise ({
redirectTo: '/'
});
});
Job
but put the same statement in angular.module (...). factory statement, and it fails / hangs silently (because .factory is a start, not a configuration instruction):
angular.module('a3App', ['ngResource']).factory('myService', function($resource) {
...
6456 Kindle AngularJS ( " " 7). ( , ).. / .