I am trying to replicate the following Angular UI example of a simple dialog with a close-button. https://github.com/angular-ui/bootstrap/blob/master/src/dialog/README.md.
However, I cannot get the dialog
parameter to be injected properly into my dialog controller.
The controllers looks like below (using CoffeScript)
angular.module('myApp', ['ui.bootstrap'])
angular.module('myApp').controller 'MyController', ($dialog, $scope) ->
$dialog.dialog().open('dialogTemplate', 'DialogController')
angular.module('myApp').controller 'DialogController', ['$scope', 'dialog', ($scope, dialog) ->
$scope.close = -> dialog.close()
]
See the Plunker for a live version: http://plnkr.co/edit/ejKh7w8Sk9H7Nz3rXhdc?p=preview
Angular gives me the following error:
Unknown provider: dialogProvider <- dialog
Any ideas on how the dialog
-parameter could be injected into DialogController
, as is seen in the docs example referred to above? I suspect this could have something to do with CoffeeScript since I am fairly new to this language, but it seems quite right when I look at the compiled output.