请帮助我为什么我要登录_Fac.GetData不是函数/
app.controller('LoginCtrls', function ($scope, Login_Fac, $window) {
$scope.GetToken = function () {
Login_Fac.GetData().then(function (d) {
alert('success...')
}).catch(function () {
alert('error...')
})
factory.js
app.factory('Login_Fac', function ($http, $window) {
var LoginScredential = {};
LoginScredential.GetData = function () {
return $http({
url: 'http://localhost:63252/api/department',
})
答案 0 :(得分:0)
将工厂更改为,
factories.factory('Login_Fac', function ($http, $window) {
var LoginScredential = {
GetData: () => {
return $http({
url: 'http://localhost:63252/api/department',
})
},
};
return LoginScredential;
});