AngularJS load service then call controller and render

后端 未结 6 1430
生来不讨喜
生来不讨喜 2020-12-28 16:29

My problem is that i need a service loaded before the controller get called and the template get rendered. http://jsfiddle.net/g75XQ/2/

Html:

<
6条回答
  •  青春惊慌失措
    2020-12-28 17:02

    even better than manually bootstrapping (which is not always a bad idea either).

    angular.module('myApp', ['app.services'])
       .run(function(myservice) {
          //stuff here.
       });
    

提交回复
热议问题