saravana_pc saravana_pc - 1 year ago 141
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=""**>

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download