$ modal.open (), problem with declaration of parameter "controller"

0

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:

  

Error: [ng: areq]

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) {    

});
    
asked by anonymous 09.08.2015 / 02:27

1 answer

0

You can not find the controller " editCrtl ", I believe you wrote the name wrong. Would not it be " editCtrl "?

    
31.08.2015 / 20:30