How to open a partial view from controller as a Jquery Mobile dialog?

What's the best way to open a nested view in AngularJS?

  • I want to open a Modal Dialog when user clicks on a button and that Modal dialog is populated with dynamic data based on the content on some of the form fields on page. I was looking at AngularUI sample code and it has html in Controller. Isn't this against the principles of MVC? http://plnkr.co/edit/FK9o5DWOqxmePZJEW75v?p=preview

  • Answer:

    UI Bootstrap Model can do that for you. Here is the link http://angular-ui.github.io/bootstrap/#/modal. The document is pretty good. There is also a demo which I think quite similar to your situation.   About your AngularUI sample code. You are right! It's bad to have html in controller, but I think they did that just for the demo purpose and you can always change that line “template:  t” to “templateUrl: 'path/to/view.html'” as commented so that a template will be dynamically loaded on demand. Anyways, have a look at the UI Bootstrap Model.

Tinh Ngo Vang Tieng at Quora Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.