lundi 26 décembre 2016

this.get in controller is 'not a function'

I'm trying to set the style of an html element and I read that I have to do it this way:

bid: {
popUpContainerDisplay: "none",
popUpDisplay: Ember.computed('bid.popUpContainerDisplay', function() {
       return Ember.String.htmlSafe("display: " + this.get('bid.popUpContainerDisplay'));
   })
},

then in my hbs file, I write

<div id="popUpContainer" style=>

However, this is giving me some errors:

jQuery.Deferred exception: this.get is not a function TypeError: this.get is not a function
at Object.<anonymous> (http://localhost:4200/assets/auction-ember.js:53:77)
at ComputedPropertyPrototype.get (http://localhost:4200/assets/vendor.js:26852:28)
at Object.get (http://localhost:4200/assets/vendor.js:31759:19)
at NestedPropertyReference.compute (http://localhost:4200/assets/vendor.js:24910:28)
at NestedPropertyReference.value (http://localhost:4200/assets/vendor.js:24720:45)
at ReferenceCache.initialize (http://localhost:4200/assets/vendor.js:55111:52)
at ReferenceCache.peek (http://localhost:4200/assets/vendor.js:55085:29)
at DynamicAttribute.flush (http://localhost:4200/assets/vendor.js:58752:35)
at SimpleElementOperations.addAttribute (http://localhost:4200/assets/vendor.js:58414:36)
at SimpleElementOperations.addDynamicAttribute (http://localhost:4200/assets/vendor.js:58374:22) undefinedjQuery.Deferred.exceptionHook @ jquery.js:3846process @ jquery.js:3642

jquery.js:3855Uncaught TypeError: this.get is not a function(…)

What am I doing wrong? Thanks.




Aucun commentaire:

Enregistrer un commentaire