Vote count:
-1
i have factory declared Malls , but i dont know why i get error 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;
});
}
};
});
asked 48 secs ago
getoffer is not a function need ,help please
Aucun commentaire:
Enregistrer un commentaire