Reputation: 12427
I'm trying to have two angular apps to one page.
my scenario: i having a website which is having lot of apps. so for eg header, footer, left sidebar, right sidebar will not change for the whole webpage, only the content will change. so i used angular templating(ng-view). while clicking on the app like calendar, it will be loaded in the ng-view. in the calendar app i have a ng-view for different views(month,week,day) so it will be like
<ng-view>
calendar or some other app
<ng-view>
month or week or day or SOMEOTHER APP TEMPLATE
</ng-view>
</ng-view>
when i tried this the browser is crashed. Is there any way to achieve this?
Upvotes: 4
Views: 1087
Reputation: 35478
ngView
is coupled with $routeProvider
, which means that it is updated according to the current route/uri. Which also means you cannot bind two different views to a single URI.
You can just use ngInclude
with a url that you want to show. It works same as ngView
in terms of fetching from server.
You would not download all of the 3 urls at once if you just provide the url, it would be fetched on demand.
However, in most of the applications, it is better to serve all the possible static files at once and then cache it, which would result in overall better performance; only the initial load would suffer a bit; which is better than a slow application in general.
I would prefer to wait 2 more seconds if that would make the whole application respond faster.
Upvotes: 1