$ injector:尝试添加服务时的unpr

时间:2018-05-10 01:05:24

标签: angularjs dependency-injection

我正在尝试使用service.js通过JSON发布http: -

App.service('loginService', function($http, $scope) {
var user = {};
this.login = function(user) {
   var request = {
      "user": user.id,
      "password": user.pass
    };
    var promise = $http.post("http://vlinux:9099/Authenticate", request);
    return promise.data;
  }
});

但我得到以下错误

  

angular.min.js:125错误:[$ injector:unpr] http://errors.angularjs.org/1.6.7/ $ injector / unpr?p0 =%24scopeProvider%20%3C-%20%24scope%20%3C-%20loginService

0 个答案:

没有答案