load jquery script after router.navigate

28 views
Skip to first unread message

Vishnu Bidarakundi

unread,
Mar 6, 2018, 1:24:39 AM3/6/18
to Angular and AngularJS discussion
I have jquery script. I want to load those scripts after the `router.navigate`.

I tried with this code author component

          this.zone.run(() =>   this.router.navigate(['/author']))

In other book  component in `ngOnit` I am  loading those scripts

    ngOnit(){ this.jquryscripts();  }

 I have added my scripts here

    jquryscripts(){ // jquey scripts }

I tried with zones and also by adding activated route  in constructor not working!!

After adding those scripts inside the `index.html` like this
<script> jquery scripts </scripts>

If I use `window.location.reload()` then my `jquery` scripts are loading!!!


Vishnu Bidarakundi

unread,
Mar 6, 2018, 7:08:04 AM3/6/18
to Angular and AngularJS discussion


After calling those scripts in ngAfterViewInit() working fine!!
Reply all
Reply to author
Forward
0 new messages