Вопрос

I use ng-view to pull in a partial to page. After that I would like to load in another partial to the page that would be right next to the initial partial that was brought in.

How would I bring in another partial from a angular controller?

Это было полезно?

Решение

Because of how ngRoute was designed, you can only have one ng-view per ng-app instance.

However, it looks like you are looking for ng-include since the routes do not seem to come into play.

Otherwise, to work around the issue of URL routing having only one template, you have two options:

  1. Use ui-router Note: Under heavy development, may introduce breaking changes.
  2. Define and use two angular applications which can reuse the controller/service code. However, then the two applications will not be able to share state.
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top