m-e-conroy / angular-dialog-service

A complete AngularJS service with controllers and templates for generating application modals and dialogs for use with Angular-UI-Bootstrap and Twitter Bootstrap
MIT License
618 stars 228 forks source link

Integration with ui.router #102

Closed Andradez closed 9 years ago

Andradez commented 9 years ago

Hello, Thank you for the excellent module.

I would like to integrate the dialog functionality with ui.router .

For example: If someone tries to access a page that requires Login, a Login dialog should show up. I have the ui.router for this functionality already in place, i just do not know how to launch the dialog when such condition occurs.

Example: I tried to inject dialogsProvider in the angular.config(function(dialogsProvider) { ... }

But i get: Error: [$injector:unpr] Unknown provider: ,dialogsProvider <- ,dialogs

Please, Can you point me in the right direction?

Thanks

m-e-conroy commented 9 years ago

Apologies for getting back to you so late, but my real job keeps my extremely busy.

You should be injecting $dialogsProvider into the config function, you're missing the dollar sign. You can create your own dialog interface by using the dialogs.create service and passing it the template, controller and any data you want. Check out this example which uses the create service of dialogs to create a custom dialog.