标签:
Notice that the view names are now specified as absolute names, as opposed to the relative name. It is targeting the ‘filters‘, ‘tabledata‘, and ‘graph‘ views located in the root unnamed template. Since it‘s unnamed, there is nothing following the ‘@‘. The root unnamed template is your index.html.
.state(‘report‘,{ views: { ‘filters@‘: { }, ‘tabledata@‘: { }, ‘graph@‘: { } } })
@后面没有名字,默认index.html(入口页面)就是模板文件
例子如下:http://plnkr.co/edit/ujgXbPJXQ3E13F9aFPBc?p=preview
例子中
.state(‘route2‘, { url: "/route2", views: { ‘route2_1@‘: { templateUrl: "route2.html", controller: function($scope){ alert("bbbb"); } }, ‘route2_2@‘: { templateUrl: "route2.html", controller: function($scope){ alert("aaa"); } } } })
route2@和route3@的@后面都没有名字,所以默认模板在入口index.html中找对应的ui-view
angular Multiple Named Views记录
标签:
原文地址:http://my.oschina.net/liangzhenghui/blog/498915