有没有人有使用KendoUI与AngularJS窗口的经验吗?
我目前使用角剑道 ,但我不能完全肯定热干净利落使用窗口。 或者,如果有是呈现一个模式对话框,并填充它通过部分加载的形式,任何其他解决方案,我接受这一点。
我当前的代码看起来是这样的:
HTML:
<div kendo-window id="addWindow" ng-hidden></div>
JS:
$scope.addSection = function() {
$("#addWindow").data("kendoWindow").open();
return false;
};
但是,我讨厌这个,感觉不对的,我怎么做的一切。 一个更好的方法有什么想法?
看看这个博客文章:
http://www.kendoui.com/blogs/teamblog/posts/13-06-24/announcing-angular-kendo-ui.aspx?utm_content=bufferbbe83&utm_source=buffer&utm_medium=twitter&utm_campaign=Buffer
他们重写角剑道,并有使用窗口的清洁方法的例子。
@anise感谢乌尔信息
最后我也解决该问题。
调节器
$scope.window;
$scope.OpenWindow= function() // custom function on click
{
$scope.DlgOptions = {
width: 550,
height: 400,
visible: false,
actions: [
"Maximize",
"Close"
]
};
$scope.window.setOptions($scope.DlgOptions);
$scope.window.center(); // open dailog in center of screen
$scope.window.open();
};
视图
<div kendo-window="window" k-visible="false" k-modal="true"> </div>
看看这个库
https://github.com/kjartanvalur/angular-kendo-window
var windowInstance = $kWindow.open({
options:{
modal: true,
title: "Window title",
width: 400,
},
templateUrl: 'modal1.html',
controller: 'modalController',
resolve: {
parameter1: function () {
return "Test...";
}
}
});
windowInstance.result.then(function (result) {
// Here you can get result from the window
});