saravana_pc saravana_pc - 8 months ago 68
AngularJS Question

Angular JS - confirm dialog with coffee script

I'm trying to use the $confirm service provided by angular. The following coffee script throws error:

$scope.showConfirmation = ->
$confirm({text: 'Can we test?'})
.then () -> $"test")

Error:$injector/unpr?p0=%24confirmProvider%20%3C-%20%24confirm **Cause : <div class="ng-scope" ng-view=""**>


See here from $confirm docs for how to inject the service for use throughout your app:

  1. Add service to your module

angular.module('myApp', ['angular-confirm']);

  1. Inject into your controller

.controller("Controller", function($confirm) {