The problem I encountered is that the loadjs file does not always load before binding it to the grid. I read other posts regarding the use of directives, but I don't understand how to use them in my case.
The code must load a specific view, each view, in turn, has a specific javascript file that must be loaded before the view finally appears
Thus, view 1 can be a datagrid with the dependency of the datagrid.js file, and view2 can be a list with the dependency listview.js
Thanks.
Function MyCtrl1($scope) { $scope.$on('$viewContentLoaded', function() { //Load file if not already loaded isloadjscssfile("js/model/gridmodel.js", "js") $("#grid").kendoGrid({ dataSource: getdatasource(), pageable: true, height: 400, toolbar: ["create"], columns: [ "ProductName", { field: "UnitPrice", title: "Unit Price", format: "{0:c}", width: "150px" }, { field: "UnitsInStock", title:"Units In Stock", width: "150px" }, { field: "Discontinued", width: "100px" }, { command: ["edit", "destroy"], title: " ", width: "210px" }], editable: "inline" }); });
}
dan source share