Usage with Angular2 component generates exception....
MHacker9404 opened this issue · comments
I have created a menu component for my Angular2 app as such:
import { AfterViewInit, Component } from '@angular/core';
import * as $ from 'jquery/dist/jquery.min.js';
import 'bootstrap/dist/js/bootstrap';
import 'bootstrap-submenu/dist/js/bootstrap-submenu';
require("style-loader!bootstrap-submenu/dist/css/bootstrap-submenu.min.css");
@Component({
selector: 'app-menu',
templateUrl: './menu.component.html',
styleUrls: ['./menu.component.scss']
})
export class MenuComponent implements AfterViewInit {
private _subMenu: any;
constructor() { }
ngAfterViewInit() {
this._subMenu = $('[data-submenu]');
console.log(this._subMenu);
$('[data-submenu]').submenupicker();
}
}
But when I run the app - I get the following exception:
query_dist_jquery_min_js__(...).submenupicker is not a function ;
So what am I doing wrong?