@Myrdhin wrote:
Hello Perhaps could you help me to understand: I have a computed like this in my controller :
isBtnSaveDisabled: computed( 'model.hasDirtyAttributes', function() { // CODE } ).readOnly()When I update an attribute (DS.attr) in my
model, this computed is not called (isBtnSaveDisabledis present in my template!).BUT, If I rewrite this computed like this :
isBtnSaveDisabled: computed( 'model.currentState.isDirty', function() { // CODE } ).readOnly()It works
!? Why ?
hasDirtyAttributesis a computed which depends ofcurrentState.isDirty? I don’t understand…I forgot to specify: we use Ember 3.12 (an update is planned but not immediately)
And if I exec
$E.get('model.hasDirtyAttributes')in my js console ($Eis my controller) , my first computed works (the computed withmodel.hasDirtyAttributes)…Strange
!
Thanks for your help.
Posts: 1
Participants: 1
!? Why ?
!