or
<script id="editor" type="text/x-kendo-template"> <input id="test" type="text" name="client_name" class="form-control" /> #$('\#test').kendoAutoComplete(["Item1", "Item2", "Item3"]);#</script>(function () { 'use strict'; angular.module('app').directive('itemDetails', itemDetailsDirective); function itemDetailsDirective() { return { restrict: 'E', scope: { itemNo: "@", }, templateUrl: "/app/inventory/itemDetails.html", controller: function ($scope, $element) { console.log("itemDetailsDirective, controller: " + $scope.itemNo); $scope.$on('ShowDetails', function (event, itemNo) { console.log("itemDetailsDirective, ShowDetails: " + itemNo); $scope.itemNo = itemNo; $scope.inventoryGridOptions = getInventoryGridOptions(); $scope.inventoryGrid.setDataSource(getGridDataSource(itemNo)); $scope.inventoryGrid.dataSource.read(); $scope.gridRecordCount = $scope.inventoryGrid.dataSource.total(); $scope.inventoryGrid.refresh(); $scope.itemDetailsWindow.center(); $scope.itemDetailsWindow.open(); }); $scope.onGridDataBound = function(e) { if ($scope.inventoryGrid) { $scope.gridRecordCount = $scope.inventoryGrid.dataSource.total(); } } $scope.close = function() { $scope.itemDetailsWindow.close(); } } }; function getGridDataSource(itemNo) { console.log("itemDetailsDirective, getGridDataSource: " + itemNo); return new kendo.data.DataSource({ type: "json", transport: { read: { url: "/api/Inventory/GetInventory?itemNo=" + itemNo, type: "GET", cache: false } }, sort: [{ field: "Loc", dir: "asc" }], pageSize: 10 }); } function getInventoryGridOptions() { return { scrollable: false, columns: [ { field: "Loc", title: "Loc", width: 50, }, { field: "QtyOnHand", title: "Qty OnHand", width: 70, format: "{0:n0}", attributes: { style: "text-align:right" } }, { field: "QtyCom", title: "Qty Com", width: 50, format: "{0:n0}", attributes: { style: "text-align:right" } }, { field: "QtyBO", title: "Qty BO", width: 50, format: "{0:n0}", attributes: { style: "text-align:right" } }, { field: "QtyXfer", title: "Qty Xfer", width: 50, format: "{0:n0}", attributes: { style: "text-align:right" } }, { field: "QtyOrd", title: "Qty Ord", width: 50, format: "{0:n0}", attributes: { style: "text-align:right" } } ] }; }; };})();