【发布时间】:2013-06-05 00:02:10
【问题描述】:
我想对第 3 方指令(特别是 Angular UI Bootstrap)进行小幅修改。我只是想添加到pane 指令的范围:
angular.module('ui.bootstrap.tabs', [])
.controller('TabsController', ['$scope', '$element', function($scope, $element) {
// various methods
}])
.directive('tabs', function() {
return {
// etc...
};
})
.directive('pane', ['$parse', function($parse) {
return {
require: '^tabs',
restrict: 'EA',
transclude: true,
scope:{
heading:'@',
disabled:'@' // <- ADDED SCOPE PROPERTY HERE
},
link: function(scope, element, attrs, tabsCtrl) {
// link function
},
templateUrl: 'template/tabs/pane.html',
replace: true
};
}]);
但我也想让 Angular-Bootstrap 与 Bower 保持同步。只要我运行bower update,我就会覆盖我的更改。
那么我该如何从这个 bower 组件中单独扩展这个指令呢?
【问题讨论】:
标签: javascript angularjs angularjs-directive angular-ui-bootstrap bower