We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Seems when the computed value is based on a sub-property, the @computed annotation style does not work. Maybe clarify in the documentation. Example:
@computed
@property({ type: Object, notify: true }) model: AppModel; // this does not compile @computed({ type: Boolean, notify: true }) isAuthenticated(model.userProfile: any): boolean { return this.model.userProfile != null; } //this works @property({ type: Boolean, notify: true, computed: "getAuthenticated(model.userProfile)" }) isAuthenticated: boolean; getAuthenticated(userProfile: any): boolean { return this.model.userProfile != null; }
The text was updated successfully, but these errors were encountered:
that's because
isAuthenticated(model.userProfile: any): boolean { }
is not valid JavaScript/TypeScript.
But perhaps @computed can be modified so to accept a name or path, e.g.:
@computed({ type: Boolean, notify: true, path: "model.userProfile" }) isAuthenticated(userProfile: any): boolean { }
Sorry, something went wrong.
Yeah, I understand why it would not work. The suggested approach looks reasonable.
No branches or pull requests
Seems when the computed value is based on a sub-property, the
@computed
annotation style does not work. Maybe clarify in the documentation. Example:The text was updated successfully, but these errors were encountered: