Open rknbgl opened 6 years ago
@JCarlosR Why liking a question if u don't have a response?
@izy2nv I interpret a like on a question as "I also have this question", so there's nothing else to respond with.
@Prinsn Got it. Hopefully we find solutions to this.
Yeah, I'm blocked on it right now, hopefully I'll find something today, for my own sanity.
@Prinsn We all will be fine. Keep pushing
Okay, so this may or may not be the solution, but this was the fix for karma, as my app was working but the tests would not work:
Where OP indicated:
"scripts": [
"../node_modules/jquery/dist/jquery.min.js",
"../node_modules/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.concat.min.js"
]
Add a path to
'node_modules/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.js'
(this was in the karma config files argument for my case)
Hello, In my Angular CLI project:
package.json ... "dependencies": { ... "jquery": "^3.3.1", "ngx-malihu-scrollbar": "^1.3.2", "@types/mcustomscrollbar": "^2.8.32" ... } ...
.angular-cli.json ... "styles": [ "assets/styles/app.css", "styles.css", "../node_modules/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.css" ], "scripts": [ "../node_modules/jquery/dist/jquery.min.js", "../node_modules/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.concat.min.js" ] ...
tsconfig.app.json ... "types": [ "jquery", "jquery-mousewheel", "mcustomscrollbar" ] ...
app.module.ts import {MalihuScrollbarModule} from 'ngx-malihu-scrollbar';
import * as $ from 'jquery'; window['$'] = window['jQuery'] = $;
... imports:[ ... MalihuScrollbarModule.forRoot() ...] ...
component.html <div class="js-custom-scrollbars e-custom-scrollbars" malihu-scrollbar [scrollbarOptions]="{ scrollbarPosition: 'outside', theme: 'minimal', advanced: { updateOnContentResize: true } }">
And I got a error: ERROR TypeError: n.mCustomScrollbar is not a function at main.a372dd5d0a99bcae16c2.bundle.js:1 at t.ZSR1.t.invoke (polyfills.9e79265bca3f3f91c6b4.bundle.js:1) at e.ZSR1.e.run (polyfills.9e79265bca3f3f91c6b4.bundle.js:1) at t.WT6e.t.runOutsideAngular (main.a372dd5d0a99bcae16c2.bundle.js:1) at t.J83O.t.initScrollbar (main.a372dd5d0a99bcae16c2.bundle.js:1) at t.initScrollbar (main.a372dd5d0a99bcae16c2.bundle.js:1) at t.ngAfterViewInit (main.a372dd5d0a99bcae16c2.bundle.js:1) at vi (main.a372dd5d0a99bcae16c2.bundle.js:1) at yi (main.a372dd5d0a99bcae16c2.bundle.js:1) at _i (main.a372dd5d0a99bcae16c2.bundle.js:1)