dimanche 10 mars 2019

How can I resolve the defineProperty deprecation error?

I received an error called DEPRECATION: [DEPRECATED] computed property 'value' was not set on object via 'defineProperty' [deprecation id: ember-meta.descriptor-on-object] and I am really sure which resource file it would like me to resolve. However, I seen the documentation about the deprecations that is related to what I've received and I found this

https://deprecations-app-prod.herokuapp.com/v3.x/#toc_use-defineProperty-to-define-computed-properties https://emberjs.com/api/ember/release/functions/@ember%2Fobject/defineProperty

Please give me an example on how to resolve it as I kind of a bit confused.

Here's my code

    value: computed('formGroup.value', function() {
      let rawValue = this.get('formGroup.value');

      return !!rawValue;
    }),


    /**
     * @public
     * @property maxLength
     * @type {number}
     */
    maxLength: null

Any response is much appreciated.




Aucun commentaire:

Enregistrer un commentaire