angular.module('app.services', []).service("test", function($http, $rootScope){
this.test=function(){
$rootScope.name="test1";
};
};
angular.module('app.controllers', []).controller('TestController', function ($scope, test) {
test.send();
})
我没有收到错误,但更改未应用于 UI。我尝试了 $scope.apply() 并得到了一个错误。