Use jQuery script with Angular 6 CLI project

后端 未结 3 1306
不思量自难忘°
不思量自难忘° 2021-01-07 05:45

I\'m developing an application using angular 6. My application use Minton Theme . I included all theme scripts in the index.html file of my angular project. Bu

3条回答
  •  执念已碎
    2021-01-07 06:15

    The Jquery code works only in the starting page and not between routes because it is not under the angular's change detection.

    You need to hook it up into the angular life cycle hooks.

    Try follow this references:

    https://medium.com/@swarnakishore/how-to-include-and-use-jquery-in-angular-cli-project-592e0fe63176

    https://www.youtube.com/watch?v=mAwqk-eIPL8

提交回复
热议问题