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
Related Q & A:
- What's the best way to start a small clothing line business?Best solution by Yahoo! Answers
- What's the best way to get a job in a restaurant?Best solution by Yahoo! Answers
- What's the best way to make a good impression at a job interview?Best solution by Yahoo! Answers
- What's the best way to connect a home theater system?Best solution by Yahoo! Answers
- What's the best way to become a lawyer?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
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.