0
我在我的控制器之一這個腳本:Angularjs和關閉編譯
function AdIssueListCtrl($scope, $http, $rootScope, $compile) {
$rootScope.nav = {
adsSideNav: true
};
//datasource for kendoui interface
$scope.kendo_adissues = new kendo.data.DataSource({
pageSize: 10,
serverPaging: true,
serverFiltering: true,
serverSorting: true,
transport: {
read: {
url: "/ads/adissue/kendo/?template=ads/ajax/json/list_adissue_kendo.html",
dataType: "json"
}
},
schema: {
total: "count",
data: 'fields'
},
sort: {'field': 'name', dir: 'asc'}
});
//delete
$scope.delete = function (id) {
var deleteuser = confirm("Are you sure you wish to delete this issue and all it's ads?");
if (deleteuser) {
$http.get("/ads/adissue/delete/" + id + "/").success(function (data) {
if (data.result == 'success') {
$scope.kendo_adissues.read();
}
});
}
};
//bind data
$scope.cdb = function (e) {
var grid = $("#adissues_grid");
$compile(grid.contents())($scope);
};
}
AdIssueListCtrl.$inject = ['$scope', '$compile', '$rootScope', '$http'];
我使用的是filewatcher在JetBrains公司PHPStorm的關閉,它基本上運行在代碼變化如下。
compiler.jar --compilation_level SIMPLE_OPTIMIZATIONS --js $FileName$
其中$ FileName $是當前打開的文件。出於某種原因,我收到以下錯誤。
ERROR - Parse error. missing name after . operator
$scope.delete = function (id) {
^
controllers.js:47: ERROR - Parse error. syntax error
}
^
controllers.js:48: ERROR - Parse error. syntax error
AdIssueListCtrl.$inject = ['$scope', '$compile', '$rootScope', '$http'];
腳本工作正常非精縮,但我很茫然,爲什麼它扔了那些分析器錯誤?有任何想法嗎?
非常感謝您的幫助。 –