0

I have a template in HTML and CSS and Javascript. I split HTML and CSS to components but I cannot adopt javascript to angular.

how to add plugin javascript to angular 2

  • have a look at this answer http://stackoverflow.com/questions/42235540/plain-javascript-as-angular-2-service/42235817#42235817 – Aravind Feb 26 '17 at 16:29

2 Answers2

0

You can call the javascript functions from the component typescript file see: Angular 2 typescript invoke javascript function

Community
  • 1
  • 1
radtelbi
  • 635
  • 1
  • 6
  • 18
0

You may import the javascript library within your main index.html file and call it from an angular2 component. However that doesn't mean automatically it will work, as e.g. DOM-manipulation is done differently in Angular2, e.g via the templates.

Myonara
  • 1,197
  • 1
  • 14
  • 33