我在制作<tabset>
视图以显示页面中的内容。此外,我正在使用 Bootstrap's Tabs and Lazy Data Loading,以便特定选项卡的控制器仅在其处于活动状态时才被初始化。我能够实现延迟加载标签。如何在Angular js的tabset中的选项卡上启用延迟加载?
<div id="panel" ng-controller="HomeController as hmctrl">
<tabset>
<tab class="nav-item" id="tab_content" title="Tab1" template-url="app/components/tab1/tab1.html"></tab>
<tab class="nav-item" id="tab_content" title="Tab2" template-url="app/components/tab2/tab2.html"></tab>
<tab class="nav-item" id="tab_content" title="Tab3" template-url="app/components/tab3/tab3.html"></tab>
</tabset>
</div>
在我的app.config我有主页
var app = angular.module('myApp', ['bootstrap.tabset','ngRoute']);
app.config(
function($routeProvider,$locationProvider) {
$routeProvider
.when('/', {
templateUrl: 'app/components/home/homeView.html'
});
});
每片只有一个路由有一个分配给他们一个单独的控制器。 我想知道如何分配路线到任何特定的标签时创建这种方式。以便我可以使用$location.path()
函数导航到它们。
我已经创建了一个相同的plnkr这里 Plnkr for the above described scenario
我添加了一个plnkr代码片段,请检查,你会知道的情况我试图描述 – Rishabh