ember.js - Ember select making model dirty on init -



ember.js - Ember select making model dirty on init -

having select in template makes model dirty , triggers observer on init, why? wanna able update model on alter update function triggered on init , don't wanna create api phone call on every single item on init.

template:

{{#each booking in bookings itemcontroller="booking"}} {{isdirty}} // true {{view "select" content=daterange value=booking.playingon optionvaluepath="content.date" optionlabelpath="content.day"}} {{/each}}

controller:

// running on init , when select in select drop down. updateplayingon: function(){ console.log(this.get('currentstate.statename')); // logs root.loaded.updated.uncommitted }.observes('playingon')

as have understood value=booking.playingon updates playingon model attribute same value , making model dirty.

seems ember select can't handle javascript objects, in case date object. making objects strings solves problem.

ember.js

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -