Am new to ember . Trying to filter the data in ember side using ember filter(computed property). I have used ember model table data to display it. The code loads the model and displays well at first go.when i try to filter it , it says no records to show.
my code:
controller:
users: alias(‘model’),
currentFilter: null,
(The above code assumes you’re using Ember 3.1, the current release. In prior versions you would still have to use this.get where I’m doing direct property access.)
The 'users.@each.active' dependent key says that filteredUsers will need to be recomputed if any of the users’s isActive fields changes (that implicitly also means it will cover the case where users are added or removed from the list too).
I tried your code getting the following error:
“Assertion Failed: You attempted to access users.isDescriptor (on <(unknown mixin):ember313>), but users is a computed property.↵
↵Due to certain internal implementation details of Ember, the users property previously contained a private “descriptor” object, therefore
users.isDescriptor would have been true.↵↵
This implementation detail has now changed and the “descriptor” object is no longer present at this location.
Soon, accessing users on this object will return the computed property’s current value (see RFC #281 for more details).↵↵
If you are seeing this error, you are likely using an addon that relies on this now-defunct private implementation detail.
If you can, identify the addon from the stack trace below and report this bug to the addon authors.
If you feel stuck, the Ember Community Slack (https://ember-community-slackin.herokuapp.com/) may be able to offer some help.↵↵
If you are an addon author and need help transitioning your code, please get in touch in the #dev-ember channel in the Ember Community Slack.”
I’m guessing you’re on Ember 2.x then? Try replacing all the this.foos and user.foos with this.get('foo') and get(user, 'foo'). Make sure you import get at the top of the file with import { get } from '@ember/object';.
(Also, watch out for the difference between your ember-cli version and your ember-source version. When people say “you need ember 3.1”, they mean ember-source , not ember-cli. By default you’ll have the same version of both, but you’re not required to.)
Hi ,
sorry , the source version is also ember 3. I checked and changed the code to this.get and the error is gone . But the behavior is same as the previous code used. Do you think anything to do with addon? whether the addon is not getting updated ?
I checked . Its nothing to do with addon . Thanks for your prompt help.
Both the code worked, the change is that the isActive field requires boolean value but we are inputting the string value, so i just added the following line to change string to boolean and it worked,
var isActiveS = (this.get(‘currentFilter’) == ‘true’);