0
在C3.js結合
我試圖與點擊條形圖來過濾表中的數據(當我點擊欄上,在表中出現相應的記錄)雙向數據AngularJS
在控制器有從對象中獲取名稱的onlick
方法。
onclick: function(d, i) {
$scope.country = d.name;
console.log($scope.country);
}
,還設有隔離範圍的表指令,它的期待國家傳遞
.directive("countryItem", function() {
return {
restrict: "E",
templateUrl: "table.html",
//isolated scope and 2-way bind country
scope: {
country: "="
},
link: function(scope, element, attrs) {
scope.countries = [{"country":"Argentina","fifarank":7},{"country":"Belgium","fifarank":12}, {"country":"Croatia","fifarank":14}];
}
};
});
所以它的指令綁定隔離範圍。
<tr ng-repeat="foot in countries | orderBy:orderByField:reverse | filter:search" country="country">
我做錯了什麼?以下是plunker,但onclick方法僅適用於Firefox和較舊版本的Chrome和Opera。