Mateusz Sobczak
Mateusz Sobczak

Reputation: 1613

Froala editor doesn't work for Angular 4 with typescript

I using angular 4 with type script and I installed ng2-froala-editor and when I want to npm start occurs error

[at-loader] ./node_modules/ng2-froala-editor/ng2-froala-editor.d.ts:1:1 
TS6053: File './node_modules/typings/globals/core-js/index.d.ts' not found.
errors @ client?0fb1:119
sock.onmessage @ socket.js?e5d0:37
EventTarget.dispatchEvent @ eventtarget.js?3e89:51
(anonymous) @ main.js?45b8:274
SockJS._transportMessage @ main.js?45b8:272
EventEmitter.emit @ emitter.js?927b:50
WebSocketTransport.ws.onmessage @ websocket.js?c17e:35
wrapFn @ zone.js?fad3:1075
ZoneDelegate.invokeTask @ zone.js?fad3:424
Zone.runTask @ zone.js?fad3:191
ZoneTask.invokeTask @ zone.js?fad3:498
invokeTask @ zone.js?fad3:1370
globalZoneAwareCallback @ zone.js?fad3:1388

I imported this:

import {FroalaEditorModule} from 'ng2-froala-editor/ng2-froala-editor';

into module.ts and this into component

import {FroalaEditorComponent} from 'ng2-froala-editor/ng2-froala-editor';

Anyone know how to solve this error?

Upvotes: 4

Views: 1294

Answers (1)

deepak singh papola
deepak singh papola

Reputation: 11

You can use angular-froala-wysiwyg (i am using it in my project)

install it via

npm install angular-froala-wysiwyg

and import in app.module.ts

import { FroalaEditorModule, FroalaViewModule } from 'angular-froala-wysiwyg';

and also import in @ngModule decorator

FroalaEditorModule.forRoot(), FroalaViewModule.forRoot() 

hope I will solve your issue

Upvotes: 1

Related Questions