tnajdek / angular-requirejs-seed

MIT License
1.03k stars 290 forks source link

Use of resolve in Routing #32

Open Mec-iS opened 10 years ago

Mec-iS commented 10 years ago

I tried to use the resolve property with $routeProvider in routes.js:

 $routeProvider.when('/url'', {
            templateUrl: '/static/app/partials/template.html',
            controller: 'Ctrl1',
            resolve: { 
                   getPromise: /* get a promise */
             }
        });

In 'Ctrl1' definition, if I try to inject getPromise like

   ...('Ctrl1', ['$scope' ... , function($scope, ..., getPromise){...}]); 

browser says "getPromiseProvider error".
Seems like the app goes to look for it only in services.js.
Am I missing something about how the app modules/files get loaded?