4 回答

TA貢獻1895條經驗 獲得超7個贊
對于在搜索中找到此內容的人來說,這也值得一提...
<div ng-repeat="button in buttons" class="bb-button" ng-click="goTo(button.path)">
<div class="bb-button-label">{{ button.label }}</div>
<div class="bb-button-description">{{ button.description }}</div>
</div>
注意的值ng-click。傳遞給的參數goTo()是綁定對象(button)的屬性中的字符串,但沒有用引號引起來。看起來AngularJS為我們處理了這個問題。我掛了幾分鐘。

TA貢獻1757條經驗 獲得超7個贊
這可行。謝謝。我正在注入自定義html并在控制器中使用angular對其進行編譯。
var tableContent= '<div>Search: <input ng-model="searchText"></div>'
+'<div class="table-heading">'
+ '<div class="table-col">Customer ID</div>'
+ ' <div class="table-col" ng-click="vm.openDialog(c.CustomerId)">{{c.CustomerId}}</div>';
$timeout(function () {
var linkingFunction = $compile(tableContent);
var elem = linkingFunction($scope);
// You can then use the DOM element like normal.
jQuery(tablePanel).append(elem);
console.log("timeout");
},100);
- 4 回答
- 0 關注
- 777 瀏覽
添加回答
舉報