diff --git a/angular-kendo.js b/angular-kendo.js index c6a2859..5ff4c97 100644 --- a/angular-kendo.js +++ b/angular-kendo.js @@ -58,6 +58,7 @@ kOptions : true, kRebind : true, kNgModel : true, + kNgDelay : true, }; return function(scope, element, attrs, widget, origAttr) { var role = widget.replace(/^kendo/, ''); @@ -183,7 +184,19 @@ ++KENDO_COUNT; - timeout(function() { + var kNgDelay = attrs.kNgDelay; + + timeout(function createIt() { + if (kNgDelay) return (function(){ + var unregister = scope.$watch(kNgDelay, function(newValue, oldValue){ + if (newValue !== oldValue) { + unregister(); + kNgDelay = null; + timeout(createIt); // XXX: won't work without `timeout` ;-\ + } + }, true); + })(); + // if k-rebind attribute is provided, rebind the kendo widget when // the watched value changes if (attrs.kRebind) {