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

Computed properties with no dependencies generate a syntax error #1348

Closed
justinfagnani opened this issue Mar 30, 2015 · 1 comment
Closed

Comments

@justinfagnani
Copy link
Contributor

Given this property definition:

    properties: {
        _documentWindow: {
          type: Object,
          computed: '_getDocumentWindow()',
        },
    }

We generate this code:

(function(old
/**/) {
    this.debounce('__getDocumentWindow()', function() {
        this._documentWindow = this._getDocumentWindow(this._data.);
    });
})
@sorvell
Copy link
Contributor

sorvell commented May 22, 2015

For this type of use case, you should use value like this:

properties: {
     _documentWindow: {
          type: Object,
          value: function() { return this._getDocumentWindow(); }
      }
}

@sorvell sorvell closed this as completed May 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants