Cathal
Cathal

Reputation: 1790

$dialog injection deprecated in v1.0.8

I'm new to angular and have inherited a project so apologies in advance if this is a basic/bad question. I have a controller

.controller('myCtrl', function($dialog) {}

thats causing the error

Error: Unknown provider: $dialogProvider <- $dialog

on another machine with angular 1.0.7 $dialog seems to originate from angular ui-bootstrap.js but is gone from 1.0.8. If this feature is deprecated does anyone have a suggestion of how to replace it?

Thanks in advance

C

Upvotes: 4

Views: 3528

Answers (1)

pkozlowski.opensource
pkozlowski.opensource

Reputation: 117370

Assuming that we are speaking about the $dialog service from http://angular-ui.github.io/bootstrap/ than the $dialog service (and hence your error) has absolutely nothing to do with the AngularJS version.

In the http://angular-ui.github.io/bootstrap/ the version 0.6.0 of the library brought complete rewrite of the $dialog service. During the rewrite it was renamed to $modal and its API has change in the non-backward-compatible way (although $modal and $dialog APIs are still pretty close so migration shouldn't be too painful).

So, what I presume is that you've updated to the latest angular-ui/bootstrap version (0.6.0) and this is why you are seeing this error. To get rid of it either downgrade to 0.5.0 or change your calls to use the new $modal service.

Upvotes: 5

Related Questions