You need to put the slimscroll constructor code inside an ngOnInit. Whether it be for a specific *.component.ts
or inside the app.component.ts
.
ngOnInit(){
$(function(){
$(".example").slimScroll({
size: '4px',
width: '100%',
height: '100%',
color: '#ff4800',
allowPageScroll: true,
alwaysVisible: true
});
});
}
The ngOnInit
is invoked after the component's html is injected into the page.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…