angular - Including external javascript libraries inside Angularjs 2 component templates -


angularjs 2 documentation mentions,

almost html syntax valid template syntax. <script> element notable exception; forbidden in order eliminate possibility of javascript injection attacks (in practice ignored).

so there other way of including external javascript files component template? (like chart plugin, j3d etc.)

my problem in details..

i have charts inside angular2 template(say charts.html). these charts interactive.. show more details when user move pointer on charts. (jquery based) . since injecting charts index.html dynamically (with angularjs), charts plugins doesn't recognizing dynamic content. (even css properties doesn't apply classes of dynamic contents).

it's not clear me want do. can use external javascript files include them html page. can use them in components.

that said, need aware executed outside context of angular2. mean won't take account regarding change detection. matter of fact, angular2 uses zonejs trigger change detection. here 2 questions regarding aspect:

here question describing how use toastr angular2: unable import toastr module angular 2.

another thing consider if external library supports modules or not able reference using require or import.

edit

regarding css, components support shadow dom. means styles isolated. need define css styles component (styles property) or change encapsulation mode viewencapsulation.none.

regarding user move supports, need listen them own in component , execute corresponding processing using ngzone able take part in change detection. have @ question:

hope helps you, thierry


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -