My app.component.html contains these code to display the slider.
<div class="slider-pro" id="slider" *ngIf="router.url == '/home'">
<script type='text/javascript'>
initSlider();
</script>
...
</div>
But it seem that the angular2 framework skip my javascript lines. My question is how to call a javascript function after *ngIf render DOM element. I tried call this function inside ngAfterViewInit(), but it doesn't worked. I need to run this function initSlider() to add onChange event.