Multiple ng-views for homepage in angularjs

北慕城南 提交于 2019-12-05 07:13:47

There would be only single ng-view on a single page. It won't possible to have multiple ng-view. If you want to load other partials then you need to use ng-include directive.

Ui-router best option which has supported the multiple views which can be nested on into the other, you could take the advantage of nested views.

You could have query params here in Angular UI Router like in format url: '/test?oneParam&twoParam' whereas this feature doesn't support in ng-route

I would suggest you to take switch from ng-route to ui-route, which has great control over url, templates & states

You can only have one ng-view.

However , it is possible to change its content in several ways: ng-include, ng-switch or mapping different controllers and templates through the routeProvider.

You can also look into using ui-router, which allows for multiple parallel views.

Here is an example of multiple views using ui-router.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!