I'm curious if there is an easy way to use 3rd party JavaScript libraries
with Angular 2, since Angular 2 uses ES6 modules:
import {Component, View} from 'angular2/angular2';
For example, to use ckeditor <http://ckeditor.com/>, normally all you need
to do for a 'Hello World' is this:
<script src="./ckeditor/ckeditor.js"></script>
<textarea name="editor1" id="editor1" ></textarea>
<script>
var editor = CKEDITOR.replace( 'editor1', {...});
</script>
But if you try this within an Angular 2 "page" you'll get an error at
runtime that CKEDITOR is undefined, even though I've included ckeditor.js
in my root HTML file. (By Angular 2 'page' I mean a module that is provided
to @RouteConfig using "new Route")
I'm assuming this is because ckeditor needs to be "wrapped" as an ES-6
module somehow, so I can then do something like:
import {CKEDITOR} from 'ckeditor/ckeditor';
to make it available to my Angular2 page? Am I understanding the problem
correctly?
Is there an easier way here, to make non-ES6 3rdParty JavaScript libraries
accessible to Angular2 applications, without having to modify them? Or do I
need to learn how to 'wrap' it as an ES6 module? (Sounds like potentially a
lot of work?)
-Vern
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.