Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import DS from 'ember-data';
- import MyModelMixin from '../mixins/my-model-mixin';
- export default DS.Model.extend(MyModelMixin, {
- name: DS.attr('string'),
- area1: DS.attr('string'),
- feeArea1: DS.attr('number'),
- area2: DS.attr('string'),
- feeArea2: DS.attr('number'),
- area3: DS.attr('string'),
- feeArea3: DS.attr('number'),
- province: DS.belongsTo('address', {async: true}),
- district: DS.belongsTo('address', {async: true}),
- ward: DS.belongsTo('address', {async: true}),
- lat: DS.attr('number'),
- lng: DS.attr('number'),
- provinceChanged: function() {
- var d = this.get('district');
- if (d.get('parentId') != this.get('province.id')) {
- this.set('district', null);
- }
- }.observes('province'),
- districtChanged: function() {
- var w = this.get('ward');
- if (w.get('parentId') != this.get('district.id')) {
- this.set('ward', null);
- }
- }.observes('district'),
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement