javascript - opening a modal in a route in AngularJS with angular-ui-bootstrap -


I'm essentially trying to answer it

However my solution is not just work Will do I get an error

Error: [$ Injector: unpr] Unknown Provider: $ modalProvider & lt; - $ modal

  My app Ui.bootstrap module injection - Here my app configuration var app = Angular.module ('app', ['ury.reiter', 'UI. Bootstrap ',' UI.bootstrap.prill ',' apfilter ',' app.services', 'app.directives',' app.controllers']) The provider gets executed during registration and configuration phase only Providers and constants / injections can be This is to prevent accidental acceleration of services before being fully configured .config (['$ stateProvider', '$ locationProvider', function ($ state provider, $ locationProvider) {// UI states, URL routing and Mapping. For more information see: https://github.com/angular-ui/Ui-Router // ------------------------- --------------------------------------------------- ------------------- -------------- $ stateProvider .state ('home', {url: '/', templateUrl .state ('Transactions', {url: '/ transaction', templateUrl: '/ views / transactions', Controller: 'TransactionsCtrl'}) .state ('/ views / index', Controller: 'HomeCtrl'}) Login ', {url: "/ login", templateUrl:' / view '/' Login ', Controller:' Login 'Ctrl)} .state (' otherwise ', {url:' * path ', templateUrl:' / views / 404 ', administrator:' error 404Ctrl '}); $ LocationProvider.html5Mode (Right);}]  

I have reduced my controller to:

  app controllers. 'Control' ('LoginCtrl', ['$ scope ',' $ Modal ', function ($ scope, $ model) {$ modal.open ({templateUrl:' modal.html '});}]); Finally, what I am hoping to achieve is that when entry is not required, then it should actually go to the entrance page, but bring a dialogue.   

I have tried to use the onEnter function in the state code I

< Strong> UPDATE

OK - this is happening because both of them are working Ui-bootstrap.js and ui-bootstrap-tpls break it - after reading the docs I thought Was that you need a template to work with U-Bootstrap. However it seems that all the plunkers only load in the file ..tpls - once I removed the UI-Bootstrap file my modal works ... I'm blind? Or does it really say that you need a docks on Github? -

Update 2

Now I just need to know how to actually enter my URL Pause / login >

OK, so by calling at $ state.go ('login') it does for me in a service.

Hello, I had a hard time through this kind of problem. However, I was able to solve it. This is what you probably need. {$ StateProvider.state ("managerState", {url: "/ Manager Records", Controller: "myController", "University", "

  app.config (function ($ state provider) ("Modular.open" ({Controller: "EmpDetailsController", Controller AS: "empDetails"), "Administrator": "Administrator", origin: "managerstate", params: {empId: 0}, onEnter: ["$ modal", function ($ Models) , TemplateUrl: 'empDetails.html', size: 'sm'}). As a result (function () {$ stateProvider.go ('^');})}}}})}}; For plunker,  

Hope it helps.


Comments