3

If I have two <div ng-view></div> elements on the same page, angular.js only uses the first one. I am looking to have two templates (with two controllers and two partials) rendered on the same page, how do I do that? The code below does not work but I'd like to have something along these lines.

<div class="row">
  <div class="large-6 small-12 columns">
    <div ng-controller="SitesHomeCtrl" >
      <div ng-view>
      </div>
    </div>
  </div>
  <div class="large-6 small-12 columns">
    <div ng-controller="UsersMeetCtrl" >
    </div>
  </div>
</div>
1

2 Answers 2

5

ui-router is the best option but if you are going with $routeProvider, you could use ng-include (with ng-show/ng-hide) or ng-switch to achieve the same.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, ng-include looks good for what I would like to achieve at this time. ui-router looks like a good solution for some later tasks, however ;)
4

I imagine you're probably going to want to look at ui-router in place of angular's router at this point, as angular's router does not support multiple ng-view elements.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.