Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4830

didReceiveAttrs not always called

$
0
0

@ArnaudValensi wrote:

Hi!

I have a controller with a store (a js object) I pass to my component.

The store looks like that:

  init() {
    this._super(...arguments);


    this.pageStore = {
      section: {
      	style: 'padding: 10px 10px'
    	}
    };
  },

I’m using DDAU (Data Down Action Up), I have an action in my controller which modify pageStore.section.style and I have a component into which I give pageStore.section as attribute.

When I modify pageStore.section.style, I want to get the new value in my component in didReceiveAttrs.

The thing is, the only way to achieve that is by using this.notifyPropertyChange('pageStore');, but this re-redender everything.

My question is, why it doesn’t work if I do this.notifyPropertyChange('pageStore.section'); ?

Here a twiddle: https://ember-twiddle.com/51f49dc015041d4075e50e4250e1d409?openFiles=controllers.application.js%2Ctemplates.components.section-row.hbs

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4830

Trending Articles