You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, by default, when the component initialises the value for list is null which throws an error saying that the property length of undefinedis not found. Is there any way to set the default value of a computed property? I'd like to avoid filling my view with multiple checks for if the property is null or has a length less than one.
I noticed it's possible to set the global default value, but I don't think this approach will work for me as in other components I am expecting the value to be null.
The text was updated successfully, but these errors were encountered:
For future reference: The second and third code examples of the usage section of the README demonstrate exactly what you were looking for: setting the default value for an individual computed property.
I'm glad you found the solution, even if your had a slightly indirect route to finding it. 😃
I am using this plugin to render a dynamic list which updates when other properties in the component change.
In my view I have a simple check to see if the computer value has a length of zero to display a "No results message":
However, by default, when the component initialises the value for
list
isnull
which throws an error saying that the propertylength
ofundefined
is not found. Is there any way to set the default value of a computed property? I'd like to avoid filling my view with multiple checks for if the property isnull
or has a length less than one.I noticed it's possible to set the global default value, but I don't think this approach will work for me as in other components I am expecting the value to be
null
.The text was updated successfully, but these errors were encountered: