I have an Angular2 component that has a template which requires a JavaScript calls to load it's html component, Ex. Facebook, Google Maps and some custom scripts.
The scripts are already loaded in the index.html and i just need to call them to update it's contents.
How do i call my javascript methods in angular2 when the view is changed again.
Code Example;
myJavaScript.js
loadData(){
...
}
$(document).load(loadData());
now i want to call my loadData() everytime the router views my component again.