mardi 17 juillet 2018

How to run jQuery from html - The ember way

I'm and trying to run jQuery from the .hbs file, which works by putting the handlebars in the file. But, then the text '[object Object]' is placed into my HTML as text. What can I change so that the jQuery still runs but does not place '[object Object]' in the HTML?


app.js below

import Controller from '@ember/controller';
import { computed } from '@ember/object';
import $ from 'jquery';

export default Controller.extend({
  NavIsViewable: true,
  fixedMenu: computed(function(){
    return $(".navbar").width($(".disable-listing-style").width());
  })
});



app.hbs below


   <div id="nav" class="nav">
     
     
   </div>


Resulting Issue below
enter image description here




Aucun commentaire:

Enregistrer un commentaire