I'm reusing several custom made javascript libraries that are useful for my actual project with angular2, my problem is after search in google and this site none of the answer have helped me, some of the solutions are hacky, i was wondering since angular2/4 was released oficially, there is any way to do this, in an proper way?
Edit: I'm adding more details, some of those libraries are for leaflet, i don't want to change to angular2-leaflet because some of the plugins like leaflet geotagged photos it has been updated since 3 years ago. i actually can see the map in the page if i load the script like this:
ngAfterViewInit() {
var s = document.createElement("script");
s.type = "text/javascript";
s.src = "./resources/js/app/visitantes_leaflet.js";
this.elementRef.nativeElement.appendChild(s);
}
but i can't send data or call methods from there (i tried to use good ol' js events on the html).
the answer from @Michal doesn't show the map, the @Joo Beck answer's 'works' but show this error : Error: Map container not found. because <div id="map"> is not added before L.map('map').
rxjs