Angular 2 execute script after template render

后端 未结 4 1472
傲寒
傲寒 2021-01-31 13:32

So I have this slider component that use materializecss javascript. So after it\'s rendered, I need to execute

$(document).ready(function(){
    $(\'body\').on(\         


        
4条回答
  •  悲哀的现实
    2021-01-31 14:15

    Actually ngAfterViewInit() will initiate only once when the component initiate.

    If you really want a event triggers after the HTML element renter on the screen then you can use ngAfterViewChecked()

提交回复
热议问题