Closed
Description
https://api.emberjs.com/ember/3.10/functions/@ember%2Fobject%2Fcomputed/filterBy
functions for ember object computed do not correctly render the examples.
I investigated it and it seems like the API does not return the full comment from the release build.
Example of response for filterBy:
"<html><head></head><body><p>Filters the array by the property and value.</p>
<p>Example:</p>
<p>```javascript
import { set } from '@ember/object';
import { filterBy } from '@ember/object/computed';</p>
<p>class Hamster {
constructor(chores) {
set(this, 'chores', chores);
}</p>
</body></html>"
It seems to have a problem with decorators when it fetches it from the inline documentation.
As seen here:
import { set } from '@ember/object';
import { filterBy } from '@ember/object/computed';
class Hamster {
constructor(chores) {
set(this, 'chores', chores);
}
@filterBy('chores', 'done', false) remainingChores; //this line
}
let hamster = new Hamster([
{ name: 'cook', done: true },
{ name: 'clean', done: true },
{ name: 'write more unit tests', done: false }
]);
hamster.remainingChores; // [{ name: 'write more unit tests', done: false }]
Metadata
Metadata
Assignees
Labels
No labels