I have an issue with a filter when inside a tabset.
angular.module('myModule', ['ui.bootstrap']);
angular.module('myModule').controller('ModalController', function($scope) {
$scope.favsLib = [1, 19];
$scope.docsLib = [{
"id": 19
}, {
"id": 23
}];
$scope.checkboxDoc = false;
$scope.favFilter = function (docsLib) {
if ($scope.favsLib.length > 0 && $scope.checkboxDoc == true) {
if ($.inArray(docsLib.id, $scope.favsLib) < 0) return;
}
return docsLib;
}
});
angular.module('myModule').directive('tabDirective', function() {
return {
scope: {
display: '='
},
controller: "ModalController",
restrict: 'AE',
replace: true,
link: function(scope, elm, attrs) {
}
};
});
here is the html I would like:
<div ng-app="myModule" ng-controller="ModalController">
<tabset>
<tab heading="Documents">
<tab-directive display="docsLib"> <input type="checkbox" ng-model="checkboxDoc">favourites
<ul>
<li ng-repeat="doc in docsLib | filter:favFilter">{{doc}}</li>
</ul>
</tab-directive>
</tab>
</tabset>
</div>
If I take the the input box outside of the tabset the filter works fine:
Working outside tabset - jsfiddle
clicking on checkbox filters results correctly.
But placing the input inside the tabset doesn't work, so there maybe an issue with the ui-bootstrap.
Has anyone any ideas? Thanks.