FAQ Database Discussion Community


Computed Property not working

ember.js,controller,ember-data,computed-properties
I'm writing the todo app and I can't get computed properties working. I want to implement computed properties in the todos/index controller so that the template can appropiately display the amount of todos undone remaining (based on the isCompleted attribute of the models). This is the code: todos/index.hbs {{input type="text"...

Getters and Setters in Swift

swift,getter-setter,computed-properties
Why do we need to use setters in the particular case below in Swift. I'm trying to convert 'display.text' String to Double. I understand that getter brings back String value and converts it to Double and assigns this value to variable newValue. Question: why we set display.text value back into...

Emberjs advanced sort hasMany association as a computed property

sorting,ember.js,has-many,computed-properties
I have asked a variant of this question here. But basically I need to create a computed property that operated on a hasMany association. I need to do sorting similar to the javascript sort function; where I can do something like files = ["File 5", "File 1", "File 3", "File...