0
NG-顯示不評估$ scope.foo.name動態添加HTML!== '根' 在控制器動態添加HTML
var button = d3.select("#someId")
.append("button")
.attr("class", "button")
.attr("ng-show","$scope.foo.name !== 'root'")
.html('{{$scope.foo.name}}').on("click", function(){
up($scope.foo);;
}) .call(function() {
//$compile(this[0][0].parentElement)($scope);
$compile(angular.element(this[0][0].parentElement))($scope);
});
您在'.attr( 「類」,「按鈕)'錯過了右引號。 –