Error in Kendo ui controls with Angular 6

2019-09-02 11:20发布

问题:

I have created project in Angular 6. In that project at first i have successfully installed @progress/kendo-angular-dateinputs using npm install then project was building successfully.

After running ng-serve, following error occurs:

node_modules/@progress/kendo-angular-dateinputs/dist/es2015/calendar/header.component.d.ts(2,37): error TS2307: Cannot find module '@progress/kendo-angular-l10n'.

node_modules/@progress/kendo-angular-dateinputs/dist/es2015/calendar/header.component.d.ts(3,29): error TS2307: Cannot find module '@progress/kendo-angular-intl'.

When i installed the above controls , my project is not building now. Following errors are coming:

ERROR in node_modules/@progress/kendo-angular- 
dateinputs/dist/es2015/calendar/models/scrollable.interface.d.ts(2,10): 
error 
TS2305: Module '"D:/Nimit/Angular 6 
Samples/Project/node_modules/rxjs/Observable"' has no exported member 
'Observable'.
node_modules/@progress/kendo-angular-dateinputs/dist/es2015/daterange/date- 
range.service.d.ts(1,10): error TS2305: Module '"D:/Nimit/Angular 6 
Samples/Project/node_modules/rxjs/BehaviorSubject"' has no exported member 
'BehaviorSubject'.
node_modules/@progress/kendo-angular-                 
dateinputs/dist/es2015/virtualization/models/scrollable.interface.d.ts
(2,10): error TS2305: Module '"D:/Nimit/Angular 6 
Samples/Project/node_modules/rxjs/Observable"' has no exported member 
'Observable'.
node_modules/@progress/kendo-angular- 
dateinputs/dist/es2015/virtualization/services/scroller.service.d.ts(1,10): 
error TS2305: Module '"D:/Nimit/Angular 6 
Samples/Project/node_modules/rxjs/Observable"' has no exported member 
'Observable'.
node_modules/@progress/kendo-angular- 
dateinputs/dist/es2015/virtualization/services/scroller.service.d.ts(2,10): 
error TS2305: Module '"D:/Nimit/Angular 6 
Samples/Project/node_modules/rxjs/Observer"' has no exported member 
'Observer'.
node_modules/@progress/kendo-angular- 
dateinputs/dist/es2015/virtualization/virtualization.component.d.ts(4,10): 
error TS2305: Module '"D:/Nimit/Angular 6 
Samples/Project/node_modules/rxjs/Observable"' has no exported member 
'Observable'.
node_modules/@progress/kendo-angular- 
l10n/dist/es2015/localization.service.d.ts(3,10): error TS2305: Module 
'"D:/Nimit/Angular 6 Samples/Project/node_modules/rxjs/Subject"' has no 
exported member 'Subject'.
node_modules/@progress/kendo-angular- 
l10n/dist/es2015/message.service.d.ts(1,10): error TS2305: Module 
'"D:/Nimit/Angular 6 Samples/Project/node_modules/rxjs/Subject"' has no 
exported member 'Subject'.
node_modules/rxjs/BehaviorSubject.d.ts(1,15): error TS2307: Cannot find 
module 'rxjs-compat/BehaviorSubject'.
node_modules/rxjs/Observable.d.ts(1,15): error TS2307: Cannot find module 
'rxjs-compat/Observable'.  
node_modules/rxjs/Observer.d.ts(1,15): error TS2307: Cannot find module 
'rxjs-compat/Observer'.
node_modules/rxjs/Subject.d.ts(1,15): error TS2307: Cannot find module 
'rxjs-compat/Subject'.

What should i do now?

回答1:

As per the docs of "kendo UI angular" you still need to install package called rxjs-compat.

If you are using angular 6, Than you can directly run following command.

ng add @progress/kendo-angular-dateinputs

This command will add all required packages for dateinputs.

Another way:

You can also run following commands to install packages if you want manual setup.

Install dateinputs, intl and l10n

npm install --save @progress/kendo-angular-dateinputs @progress/kendo-angular-intl @progress/kendo-angular-l10n

Also install rxjs-compat

For Angular v6 and higher: npm install --save rxjs-compat@6

For Lower versions: npm install --save rxjs@^5.5

This setup should be working fine.