0
當我試圖將一個值從ng-repeat
傳遞到一個函數,它似乎從字面上從放入的文本中讀取數據,而我想傳遞值.. ..從過濾器傳遞值作爲角度爲js函數的參數
<li ng-repeat="event in filtered = (events | filter:query) | orderBy:'-event_date'" >
<div class="event-info">
<strong>{{event.event_name}}</strong><br />
</div>
<div ng-click="prepare_edit('{{event.event_name}}')" >EDIT</div>
</li>
控制器:
$scope.prepare_edit = function(event_name) {
window.alert(event_name);
}
輸出:{{event.event_name}},而我想實際值