Bir global hizmet değişkeninde bir yanıt değişkeni depolamaya çalışıyorum. Bu benim service
geçerli:AngularJs global hizmeti
(function() {
angular.module('employeeApp')
.service('constants',constants);
function constants() {
this.url = 'http://domain.dev/api/v1/';
this.role = '',
this.companyid = '',
this.name = ''
}
})();
loginFactory: Ben homecontroller içinde şirket kimliği erişmeye çalıştığınızda
factory.login = function(email,password)
{
var vm = this;
vm.companyid = constants.companyid;
data = {"email": email, "password": password};
requestFactory.post(GLOBALS.url + 'login', data)
.then(function (response) {
vm.role = response.data.result.Employee.Role;
vm.companyid = response.data.result.Employee.CompanyId;
factory.setToken(response.data.result.Employee.api_token);
$cookieStore.put('employeeid', response.data.result.Employee.EmployeeId);
$location.path('/home');
}, function() {
console.log('Niet ingelogd!');
});
}
boş. Neyi yanlış yapıyorum. Şu an saatlerce bakıyorum ama bir çözüm bulamıyor!
bakınız. Sorun bu olabilir mi? – kubuntu
@kubuntu Fabrikamda bir şey ayarlamaya çalışıyorum. – Jamie
Virgülleri sabitler() 'de noktalı virgül olarak değiştirin. Shoulld çalışması – kubuntu