当您创建剑道窗口,在定义你要引用是要绑定到数据视图或模板控制器你想要在窗口中显示。
这是我的index.html
Contenido
{{ fName }}
.example {
min-height: 400px;
}
var MyApp = angular.module("KendoDemos", [ "kendo.window", "kendo.directives" ]);
MyApp.controller("MyCtrl", MyCtrl);
MyApp.controller("InvoiceController", InvoiceController);
function MyCtrl($scope, $kWindow) {
var noteNumber = 0;
//$scope.hello = "Hello from Controller!";
$scope.fName = 'Esta es una prueba data from parent window to child';
var noteWindowDivId = "noteWindow" + noteNumber;
$scope.open=function(){
var windowInstance = $kWindow.open({
options:{
draggable: true,
resizable: true,
width: "500px",
height: "375px",
title: 'Multiventanas',
scrollable: true,
actions: ["Minimize", "Maximize", "Close"],
visible: false
},
templateUrl: 'template/window/databinding2.html',
controller: 'InvoiceController',
resolve: {
message: function() {
return $scope.fName;
}
}
});
};
}
function InvoiceController($scope, message) {
$scope.message333 = message;
$scope.qty = 1;
$scope.cost = 2;
$scope.inCurr = 'EUR';
$scope.currencies = ['USD', 'EUR', 'CNY'];
$scope.usdToForeignRates = {
USD: 1,
EUR: 0.74,
CNY: 6.09
};
$scope.total = function total(outCurr) {
return $scope.convertCurrency($scope.qty * $scope.cost, $scope.inCurr, outCurr);
};
$scope.convertCurrency = function convertCurrency(amount, inCurr, outCurr) {
return amount * $scope.usdToForeignRates[outCurr]/$scope.usdToForeignRates[inCurr];
};
$scope.pay = function pay() {
window.alert("Thanks!");
};
}
MyCtrl.$inject = ['$scope', '$kWindow'];
databinding2.html
Invoice:
Quantity:
Costs:
{{c}}
Total:
{{total(c) | currency:c}}
Pay
{{message333}}
你不必写一个完整的HTML格式,你外部HTML文件(儿童),因为它取决于它的父母形式。我希望这个例子可以帮助别人!祝你今天愉快。