可以在另一个ng视图中查看ng-view

时间:2022-08-15 19:41:30

Nested ng-view is possible in angularjs or if any alternative solution for this one. If it is possible for ng-view inside the ng-view.

可以在angularjs中使用嵌套的ng-view,或者如果有任何替代解决方案。如果可以在ng-view中进行ng-view。

1 个解决方案

#1


2  

use ui-router for nested views.. read about comparison between ngRoute & uiRouter here

使用ui-router进行嵌套视图..在这里阅读ngRoute和uiRouter之间的比较

below is an example of how to define nested views...

下面是如何定义嵌套视图的示例...

.state('bulletinBoard', {
        url: '/bulletinBoard',
        templateUrl: '../src/app/bulletinBoard/views/bulletinBoard.part.html',
        views: {
            'tradeFeed': {
                controller: 'tradeFeedController',
                templateUrl: '../src/app/bulletinBoard/views/tradeFeed.part.html'
            },
            'newsFeed': {
                controller: 'newsFeedController',
                templateUrl: '../src/app/bulletinBoard/views/newsFeed.part.html'
            }
        }
        });

the best source for reading about nested view, is the official documentation link here

阅读嵌套视图的最佳来源是此处的官方文档链接

#1


2  

use ui-router for nested views.. read about comparison between ngRoute & uiRouter here

使用ui-router进行嵌套视图..在这里阅读ngRoute和uiRouter之间的比较

below is an example of how to define nested views...

下面是如何定义嵌套视图的示例...

.state('bulletinBoard', {
        url: '/bulletinBoard',
        templateUrl: '../src/app/bulletinBoard/views/bulletinBoard.part.html',
        views: {
            'tradeFeed': {
                controller: 'tradeFeedController',
                templateUrl: '../src/app/bulletinBoard/views/tradeFeed.part.html'
            },
            'newsFeed': {
                controller: 'newsFeedController',
                templateUrl: '../src/app/bulletinBoard/views/newsFeed.part.html'
            }
        }
        });

the best source for reading about nested view, is the official documentation link here

阅读嵌套视图的最佳来源是此处的官方文档链接