I am encountering an issue with my factory declaration for Malls. It seems that I am getting the error message get offer is not a function!
.controller('confirmCtrl', function($scope,Malls,$stateParams,$log) {
$scope.offers = Malls.getoffer($stateParams.offersId);
console.log($scope.offers,"test");
})
var offers=[{
id:0,
message:'Are you sure want to buy this coupon?'
}, {
id:1,
message:'Are you sure want to buy this coupon?'
}];
return {
all:function(){
return offers;
},
getoffer: function(offersId) {
return _.find(offers, function(offers) {
return offers.id == offersId;
});
}
};
});