I'm trying to call another function within my factory but i get this error. i did what others said in this link. i could not find the problem. where did i go wrong? Thanks!
.factory('UserPreferences',function(Http,ngDialog,Notification){
var settings = {}
retu {
authenticated: false,
settings:{},
save_settings: function(data){
var data = {
url: '/pointofsale/userpreferences/save',
data: data
}
Http.Post(data)
.success(function(data){
statusMessage = data
ngDialog.closeAll(0)
})
},
authenticate_change_settings: function(user,settings){
this.settings = settings
var data = {
url: '/pointofsale/authenticate_change_settings',
data: user
}
Http.Post(data)
.success(function(data){
if(data){
this.authenticated = true;
this.save_settings(this.settings);
}
}).error(function(data){
Notification.error(data)
})
}
}

