0
I have a problem to use the $dialog angular, before it was working normally, and then started appearing the error below:
angular.min.js:118 TypeError: $dialogs.confirm is not a function
at m.$scope.deleteCapacity (capacityCtrl.js:77)
Controller:
$scope.deleteCapacity = function(capacity) {
var dlg = $dialogs.confirm("Confirma a exclusão?", "Você deseja excluir a capacitação " + capacity.nameCapacity + " ?");
dlg.result.then(function(btn) {
capacityService.removeCapacity(capacity.idCapacity, function(data) {
$scope.capacities = capacityService.getCapacity();
});
}, function(btn) {
});
$scope.capacities = capacityService.getCapacity();
};
Index:
<script type="text/javascript" src="js/libs/angular.min.js"></script>
<script type="text/javascript" src="js/libs/angular-ui-router.min.js"></script>
<script type="text/javascript" src="js/libs/angular-resource.min.js"></script>
<script type="text/javascript" src="js/libs/angular-sanitize.js"></script>
<script type="text/javascript" src="js/libs/ui-bootstrap-custom.js"></script>
<script type="text/javascript" src="js/libs/jquery.js"></script>
<script type="text/javascript" src="js/libs/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/libs/dialogs.js"></script>
<script type="text/javascript" src="js/services/capacityService.js"></script>
<script type="text/javascript" src="js/controllers/capacityCtrl.js"></script>
<script type="text/javascript" src="js/config/routers.js"></script>
<script type="text/javascript" src="js/config/app.js"></script>
I know the dialogs removed the
$
because it is reserved of the Angularjs, try to remove the $.– Flavio Misawa
I took it but it’s still making a mistake...
– Marquin Ferreira
TypeError: dialogs.confirm is not a function
 at b.$scope.deleteCapacity (capacityCtrl.js:77)
– Marquin Ferreira
.controller('capacityController', ['$scope', '$state', '$dialogs', '$location', 'capacityService', '$timeout', function($scope, $state, $dialogs, $location, capacityService, $timeout)
The error was due to the order of the directives...– Marquin Ferreira