How use ng-view inside ng-view?
-
I have main ng-view, and controller with left\right side. The right side is fixed, but left side I want change by other templates and controllers. http://plnkr.co/edit/MTxmmZWRY7O0nH88qK3F <div ng-controller="MainCtrl as main"> Choose: <a href="Book/Moby">Moby</a> | <a href="Book/Moby/ch/1">Moby: Ch1</a> | <a href="Book/Gatsby">Gatsby</a> | <a href="Book/Gatsby/ch/4?key=value">Gatsby: Ch4</a> | <a href="Book/Scarlet">Scarlet Letter</a><br/> <div class="left-side view-animate-container"> <div ng-view class="view-animate"></div> </div> <div class="some-fixed-right-side"> <pre>$location.path() = {{main.$location.path()}}</pre> <pre>$route.current.templateUrl = {{main.$route.current.templateUrl}}</pre> <pre>$route.current.params = {{main.$route.current.params}}</pre> <pre>$routeParams = {{main.$routeParams}}</pre> </div> </div>
-
Answer:
I used a solution derived from here: http://www.bennadel.com/blog/2420-Mapping-AngularJS-Routes-Onto-URL-Parameters-And-Client-Side-Events.htm Allowing me to effectively nest views (and skipping the limited ng-view altogether) After doing so, this other (simpler, better, I believe) solution appeared: http://angular-ui.github.com/ (scroll down to "Route Checking")
Mediator at Stack Overflow Visit the source
Other answers
You can not. Just use https://github.com/angular-ui/ui-router for that. It allows using nested views.
Mikalai
Related Q & A:
- How to implement search view for list view?Best solution by Stack Overflow
- how to pass data from table view to second view controller?Best solution by Stack Overflow
- Why cannot we use static keyword inside a method in java?Best solution by Stack Overflow
- How to show text inside a progressbar?Best solution by Stack Overflow
- How to use ng-switch in ng-repeat?Best solution by Stack Overflow
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.