[英]How to call function from modal html?
我嘗試以我的模式進行此操作:
<td colspan="4" class="text-center">{{$rootScope.getDate(proposal.date_from)}}</td> <td colspan="4" class="text-center">{{getDate(proposal.date_to)}}</td>
第一個td什么都不輸出第二個td輸出{{getDate(proposal.date_to)}}作為字符串如何正確調用函數? 它們都在兩個范圍內定義
在您的控制器中,將getDate
函數附加到$scope
,它應該看起來像這樣: $scope.getDate = function(date) { ... }
。 之后,您可以使用以下格式調用getDate
: <td colspan="4" class="text-center">{{getDate(proposal.date_to)}}</td>
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.