首页 新闻 会员 周边 捐助

angluar注入模块

0
[待解决问题]

js文件1

var loginApp = angular.module("loginApp", ["loginService"]);

js文件2

loginApp.controller("loginValidate", ["$scope", "$params","loginRequestService",function ($scope, $params, loginRequestService) {
$scope.LoginCheck = function (params, isValid) {
  if (isValid) {
   angular.element(".alert alert-error hide").show();
   angular.element(".alertError").html("请输入用户名和密码")
   $scope.sName = true;
  }
  else {
   $scope.sName = true;
  }
  params = {
   "username":$scope.username,
   "password":$scope.password
  }
  loginRequestService.login(params).success(function (response) {
   var result = angular.fromJson(response.result);
   if (result.IsSuccess == false) {
    angular.element(".alert alert-error hide").show()
    angular.element(".alertError").html(result.Message);
    $scope.sName = true;
   }
  })
 }
}])

js文件3

//服务
var loginService = angular.module("loginService",[]);
//请求服务
loginService.factory("loginRequestService", ["$http",function ($http) {
 //请求参数
 var requestParams = {
  method: "",
  url:"",
  headers:{},
  params:{}
 };
 //$http({requst})
 var requst = {
  login:function (data) {
   requestParams.method = "get";
   requestParams.url = "http://localhost:30456/api/login";
   requestParams.headers = { "content-type":"application/json" }
   requestParams.params = response;
   RequestService($http, requestParams);
  },
 };
}]);
//请求服务
function RequestService($http, request) {
 var result = $http(request);
 return result;
}

为什么一直提示 Error: [$injector:unpr]。。。。求解答

灬丶的主页 灬丶 | 初学一级 | 园豆:3
提问于:2018-05-02 14:37
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册