Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage with Angular2 component generates exception.... #45

Open
MHacker9404 opened this issue Apr 11, 2017 · 0 comments
Open

Usage with Angular2 component generates exception.... #45

MHacker9404 opened this issue Apr 11, 2017 · 0 comments

Comments

@MHacker9404
Copy link

MHacker9404 commented Apr 11, 2017

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant