如何从modal html调用函数?

时间:2017-12-26 21:42:25

标签: javascript angularjs

我尝试在我的模态中执行此操作:

<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)}}作为字符串 如何正确调用函数?它们在两个范围都定义

1 个答案:

答案 0 :(得分:0)

在您的控制器中,将getDate功能附加到$scope,其外观应如下所示:$scope.getDate = function(date) { ... }。在此之后,您可以使用以下格式致电getDate<td colspan="4" class="text-center">{{getDate(proposal.date_to)}}</td>

相关问题