ES6 Denetleyici sınıfım aşağıdaki gibidir. Kod derleme bölümündeki $ compile, $ location gibi Angular yöntemlerini uygulayamıyorum. Bu "Uncaught (vaat) TypeError: hata." Derleme bir işlev değil (…) "Bu erişim içinde bu erişim elde etmek için ok işlevini kullanıyorum. Bunu nasıl çözeceğine dair bir fikrin var mı?
import DashboardService from './DashboardService';
class DashboardController
{
/*@ngInject*/
constructor($scope, DashboardService, $location, $compile, PLATFORM)
{
this.$scope = $scope;
this.DashboardService = DashboardService;
this.$location = $location;
this.$compile = $compile;
this.PLATFORM = PLATFORM;
}
UpdateGrid(clients)
{
this.PLATFORM.miraLoader.moduleImport('platform!kendo-ui').then((kendo) => {
var dataSource = new kendo.data.DataSource({ data: clients, pageSize: 10 });
angular.element("#GridTest").kendoGrid({
height: 415,
scrollable: true,
dataBound: function(){this.$compile(angular.element("#GridTest"))(this.$scope);}
});
var grid = angular.element("#GridTest").data("kendoGrid");
grid.setDataSource(dataSource);
grid.dataSource.read();
this.$compile(angular.element("#GridTest"))(this.$scope);
});
}
GoToClient(id){ this.$location.path('/Client/'+id); }
AdvisorChange() {
this.DashboardService.ClientsGet(this.wiquid, this.advisorid).then((clients) => {
this.UpdateGrid(clients.data.d);
});
}
}
export default DashboardController;
Teşekkürler Duncan .. Şimdi iyi çalışıyor ... –