hello, when i want to implement the scrollable directive i get the following error.
core.js:6456 ERROR TypeError: $(...).slimScroll is not a function at ScrollableDirective.ngOnInit (scrollable.directive.ts:15:39) at callHook (core.js:2526:1) at callHooks (core.js:2495:1) at executeInitAndCheckHooks (core.js:2446:1) at refreshView (core.js:9460:1) at refreshComponent (core.js:10616:1) at refreshChildComponents (core.js:9242:1) at refreshView (core.js:9495:1) at refreshEmbeddedViews (core.js:10570:1) at refreshView (core.js:9469:1)
Hi, "slimScroll is not a function" means the plugin is not loaded. One cause could be that you are using the seed project and it does not includes jquery by default. Slimscroll is a jQuery plugin. Check the angular.json file to make sure you have jquery included instead of the wrapper.js script (which is a vanilla js replacement for some jquery methods)
angular error scrollable directive
core.js:6456 ERROR TypeError: $(...).slimScroll is not a function
at ScrollableDirective.ngOnInit (scrollable.directive.ts:15:39)
at callHook (core.js:2526:1)
at callHooks (core.js:2495:1)
at executeInitAndCheckHooks (core.js:2446:1)
at refreshView (core.js:9460:1)
at refreshComponent (core.js:10616:1)
at refreshChildComponents (core.js:9242:1)
at refreshView (core.js:9495:1)
at refreshEmbeddedViews (core.js:10570:1)
at refreshView (core.js:9469:1)
ngOnInit() {
$(this.element.nativeElement).slimScroll({
height: (this.height || this.defaultHeight)
});
}
I don't know if I was missing something.
One cause could be that you are using the seed project and it does not includes jquery by default. Slimscroll is a jQuery plugin.
Check the angular.json file to make sure you have jquery included instead of the wrapper.js script (which is a vanilla js replacement for some jquery methods)
Let me know if you have any question
Regards