javascript - Resolve data for common controller angularjs -
Just wanted to know if there is no way to handle data for an administrator, which is not kept by any route (Normal BaseController for all actions)
App.controller ('BaseCtrl', function ($ http, service) {$ scope.data = null; Service.getData (function ) {$ Scope.data = data;});}); Am I service. Gedetta (); App.controller ('BasCtrl', function ($ http, baseData) {$ Scope.data = BaseData;}); Base.resolve = {Besadata: function (service) {return service .getData (); }} Please help if possible.
PS: I want to prepare data from the service before loading BaseCtrl and inject it into it. "post-text" itemprop = "text"> If your baskuton is full with your homepage then you have to fetch the data before loading the base code and into the window.BaseData, other intelligent Whatever the controller there is loaded the load data before there.
If basectrol is the first page, then you can implement it through an instant-applied function in different JS page and put that JS file first in the BaseCtrl JS file.
For example, Fetchdata.js
(function () {window.BaseData = function () {...}); }) (); You can access your controller from your angle controller to the basdata through the injection global parameter.
Now put files of this order
You see that you have to break the rules to do this, but anyway, Congress resource resources in your service are also nothing from AJAX implementation.
Comments
Post a Comment