0
I have this controller
angular
.module("ngCribs").controller("cribsController", function ($scope, cribsFactory) {
$scope.cribs = cribsFactory.getCribs();
});
and that Factory
angular.module("ngCribs")
.factory("cribsFactory", function (){
var cribsData = [
{
type: "Apartamento",
price: 22000,
andress: "Estrada do Nagao",
description: "Casa excelente, 4 quartos"
},
{
"type": "Casa",
price: 320.000,
andress: "Centro, Mogi",
description: "Casa excelente, 2 quartos"
},
{
"type": "Apartamento",
price: 18000,
andress: "Cesar De Souza",
description: "Casa excelente, 4 quartos"
}
];
function getCribs() {
return cribsData;
}
return {
getCribs: getCribs()
};
});
error is to chaamr the getCribs of the message that is not a function
Error Error: cribsFactory.getCribs is not a Function