我有以下包含在AngularJS指令中的kendoDatePicker;該指令應該顯示選擇器打開日曆,但不是。這段代碼有什麼問題? This is the plunk。如何在AngularJS指令鏈接中聲明Kendo UI對象
HTML:
<dir2></dir2>
的Javascript:
var app = angular.module("app", [ "kendo.directives" ]);
function MyCtrl($scope) {
}
app.directive('dir2', function() {
var directive = {};
directive.restrict = 'A';
directive.template = '<input kendo-date-picker="picker" />';
directive.link = function (scope, element, attrs) {
scope.picker.open();
};
return directive;
});
你不需要100毫秒。您只需將其推送到在之前的模板中呈現的下一個摘要循環中。 – PSL 2014-12-27 17:16:52
更改爲1毫秒 – ps0604 2014-12-31 14:53:30