app.service('dataService', [function ($http,$q) { var deferred = $q.defer(); $http.get(url).then(function(data){ deferred.resolve(data); }); this.getData = function(){ return deferred.promise; }}]);
angular這樣調(diào)用數(shù)據(jù)和直接調(diào)用什么區(qū)別?
呼啦一陣風
2018-09-12 09:10:58