我需要完成的事情:
$http({method: 'GET',url: '/config'}).then(function(res) { configProvider.setConfig(res.data.config); }
我需要完成的事情:
$http({method: 'GET',url: '/config'}).then(function(res) { configProvider.setConfig(res.data.config); }
请参考以下代码:
(function() { var application,bootstrapApplication,fetchData; application = angular.module('app'); fetchData = function() { var $http,initInjector; initInjector = angular.injector(['ng']); $http = initInjector.get('$http'); $http.get('<url>'); }; bootstrapApplication = function() { angular.element(document).ready(function() { angular.bootstrap(document,['app']); }); }; fetchData().then(bootstrapApplication); })();
我希望它有所帮助.