您好我在ng-click函數中傳入ng-repeat參數時遇到問題。 我的NG-TR重複是:傳遞參數以ng-click方式重複ng功能
<tr ng-repeat="generalSurvey in surveys">
<td>
<% generalSurvey.survey.trans_id %>
</td>
<td>
<% generalSurvey.survey.created_at | date:'yyyy-MM-dd HH:mm:ss' %>
</td>
<td>
<% generalSurvey.save_answers_date | date:'yyyy-MM-dd HH:mm:ss' %>
</td>
<td>
<% generalSurvey.survey.base_survey.name %>
</td>
<td>
<% generalSurvey.survey.status.name %>
</td>
<td>
<div ng-click = "editCase({{ generalSurvey.caseData.caseId }})"><% generalSurvey.caseData.caseId %></div>
</td>
<td>
<% generalSurvey.caseData.firstContact %>
</td>
</tr>
下面我展示我的指令代碼:
link: function (scope, element, attrs) {
scope.surveys = {};
scope.getSurveys = function() {
surveysClient.getAll(function (callback) {
scope.surveys = callback.data;
console.log(scope.surveys);
});
};
// Pobranie danych o ankietach
scope.getSurveys();
scope.editCase = function (selectedCase) {
CicCase.get(parseInt(selectedCase), function (callback) {
console.log("siema");
});
}
},
我怎麼能正確傳遞這個參數?
您不必使用大括號{{}}在NG-點擊ng-click =「editCase(generalSurvey.caseData.caseId) – Vivz