0
如何使用角度選項卡指令中的href鏈接通過路由轉到視圖。不知何故,我認爲你必須將root作用域添加到指令中。從角度選項卡路由指令示例
appTreeDirectives.directive( '標籤',函數(){ 返回{ 限制: 'E', transclude:真, 範圍:{}, 控制器:功能($範圍,$元件){ VAR窗格= $ scope.panes = [];
$scope.select = function(pane) {
angular.forEach(panes, function(pane) {
pane.selected = false;
});
pane.selected = true;
}
this.addPane = function(pane) {
if (panes.length == 0)
$scope.select(pane);
panes.push(pane);
}
},
template:
'<div class="tabbable">' +
'<ul class="nav nav-pills nav-stacked">' +
'<li ng-repeat="pane in panes" ng-class="{active:pane.selected}">'+
'<a href="" ng-click="select(pane)"> <i class="fa fa-list-alt fa-lg"></i></span> {{pane.title}}</a>' +
'</li>' +
'</ul>' +
'<div class="tab-content" ng-transclude></div>' +
'</div>',
replace: true
};