在剑道窗口的模板属性中使用AngularJS代码
Using AngularJS code in template property of kendo window
我以以下方式将kendo窗口与AngularJS一起使用。
HTML代码
<div kendo-window="showProspectDetailWindow" k-title="'Prospect Detail window'"
k-width="" k-height="" k-visible="false"
k-content="{template:confirmationWindowTemplate}"
k-on-open="" k-on-close=""></div>
JavaScript代码
$scope.confirmationWindowTemplate = 'Are you sure you want to delete?<br />This data will not be recoverable, do you want to continue ?<br /><div class="pull-right"><button class="k-primary" ng-click = "yesButton()">Yes</button><button class="k-button" ng-click="noButton()"> No</button></div>';
我以以下方式在脚本中创建了一个模型
$scope.createProspectDetailModel = function(data)
{
$scope.prospectDetail.AccountId = data.AccountId;
$scope.prospectDetail.BusinessType = data.BusinessType;
$scope.prospectDetail.FirstName= data.FirstName;
}
以上代码有效。在调试器的帮助下,我可以验证数据字段中的值是否进入每个$scope.prospectDetail值。然而,当我将模板更改为时
$scope.confirmationWindowTemplate = 'Are you sure you want to delete {{prospectdetail.FirstName}}'
它不起作用。我也试过
$scope.confirmationWindowTemplate = 'Are you sure you want to delete {{#= prospectdetail.FirstName #}}'
但效果不太好。我在SO上引用了这个链接,但没有帮助。我找了很多,但仍然找不到解决这个问题的办法。如有任何帮助,我们将不胜感激。
好的。我自己找到了答案。我更改了HTML代码。删除k含量
<div kendo-window="confirmationWindow" k-title="'Confirmation window'"
k-width="" k-height="" k-visible="false"
k-on-open="" k-on-close=""></div>
并在脚本中分配
$scope.confirmationWindow.content('Are you sure you want to delete'+ $scope.prospectDetail.FirstName '?<br />
相关文章:
- Angularjs代码未在匿名函数中运行
- AngularJS代码不工作
- 在剑道窗口的模板属性中使用AngularJS代码
- AngularJS代码在一个代码笔中工作,但在移动时会中断
- 将angularjs代码从1.0.3升级到1.4.9
- 用于按键重定向的 AngularJS 代码应该是服务或指令
- 安装 ng-mouseover 和 ng-mouseout 会导致效率极低的 AngularJS 代码
- 如何使ng-bind-html编译angularjs代码
- 在 AngularJS 代码中使用此扩展的正确方法是什么
- 如何防止黑盒脚本在逐步执行Javascript AngularJS代码时显示
- 我已经完成了 AngularJS 代码,但数据没有显示
- AngularJS代码只在html文件中运行,而不在外部文件中运行
- “控制器”的AngularJS代码无法启动
- AngularJS代码在ng重复后不工作
- 请建议如何为以下angularjs代码编写Jasmine测试用例
- 如何将jQuery代码转换为可用的AngularJS代码
- 执行AngularJS代码中作为属性提供的回调方法
- AngularJS代码尽管在控制器中使用了数组语法,但没有正确缩小
- 我的AngularJS代码都没有被执行
- js倒计时打破了我的angularjs代码