hi I try to save in cookies after a web response. Here is my code
angular.module('myApp').controller('SignInController',['WebService',function(WebService, $cookies){
this.formData = {};
this.signIn = function(formData){
WebService.login(formData).then(function successCallback(data){
//console.log("Success callback:"+JSON.stringify(data));
var response = data.data;
var message = response['message'];
if (message == 'Success') {
$cookies.put("id", response['id']);
$cookies.put("number", response['number']);
}else{
}
console.log('Message:'+message+" id:"+ $cookies.get('id'));
},function errorCallback(error){
console.log("Error"+JSON.stringify(error));
});
this.formData = {};
};
}]);
i have included ngCookies as module while creating main angular module. What I'm doing wrong here? Anyone show me correct way. Thank you.