vendredi 2 novembre 2018

How do I reference a function in the vendor folder in a component?

I'm currently receiving an ES Lint error in the following JS file for a component:

import Component from '@ember/component';

export default Component.extend({


  didInsertElement() {
    this.$(document).ready(function () {
      App.init();
    });

  },

  actions: {

    toggleDropdownCurrentUser() {
      this.toggleProperty('userDropDownOpen');
    },

    toggleNav() {
      this.toggleProperty('navDropDownOpen');
    }

  }

});

The function App is reporting as not defined. This function is in the vendorjs files that is compiled on build and definitely works.

I tried to import App from ../../../vendor/apps but I can't seem to get the folder structure correct and end up with an error suggesting I can't go back to the root of the project.

Is there some methodology I am missing?




Aucun commentaire:

Enregistrer un commentaire