I'm trying to open a modal through the view, by the showModal () method, the problem is that I get an error regarding the "editCrtl" controller declaration, which is very strange, since it is already loaded in the index and is perfectly created . Can anyone help me?
Stacktrace:
View controller code:
app.controller('listCtrl', function($scope, Crud, filterFilter, $modal) {
$scope.veiculos = Crud.getList();
$scope.currentPage = 1;
$scope.totalItems = $scope.veiculos.length;
// Itens por página
$scope.entryLimit = 6;
$scope.noOfPages = Math.ceil($scope.totalItems / $scope.entryLimit);
$scope.$watch('search', function(newVal, oldVal) {
$scope.filtered = filterFilter($scope.veiculos, newVal);
$scope.totalItems = $scope.filtered.length;
$scope.noOfPages = Math.ceil($scope.totalItems / $scope.entryLimit);
$scope.currentPage = 1;
}, true);
$scope.remove = function(veiculo) {
var index = $scope.veiculos.indexOf(veiculo);
if (index != -1) {
Crud.remove(index);
}
}
$scope.showModal = function(veiculo) {
var modalInstance = $modal.open({
animation : true,
templateUrl : './app/view/vehicle-register.html',
controller : 'editCrtl',
resolve : {
veiculo : function() {
return veiculo;
}
}
});
};
});
Modal Controller
app.controller('editCtrl', function($scope, $modalInstance, veiculo) {
});