-
-
Save igorstajic/f722c30af96f33e5cd7391e3dfdb4478 to your computer and use it in GitHub Desktop.
Select OnChange Error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
actions: { | |
ComboChangeCaseOne(passItem, propertyToChange, selectedValue){ | |
alert(`${passItem}, ${propertyToChange}, ${selectedValue}`); | |
}, | |
ComboChangeCaseTwo(passItem, propertyToChange, selectedValue, fullEvent){ | |
alert(passItem, propertyToChange, selectedValue, fullEvent); | |
} | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Model from 'ember-data/model'; | |
import attr from 'ember-data/attr'; | |
import { belongsTo, hasMany } from 'ember-data/relationships'; | |
import SimpleItem from '../models/SimpleItem'; | |
/** | |
* Model to simulate an AJAX CALL To retrieve all items | |
* | |
**/ | |
export default Model.extend({ | |
items: [], | |
isReady: false, | |
init(){ | |
this.set('items', []); | |
this.set('isReady', false); | |
}, | |
SetData(){ | |
let promise = new Promise((resolve, reject) => { | |
setTimeout(() => { | |
this.get('items').pushObject(SimpleItem.create({name: 'itemOne'})); | |
this.get('items').pushObject(SimpleItem.create({name: 'itemTwo'})); | |
this.get('items').pushObject(SimpleItem.create({name: 'itemThree'})); | |
this.set('isReady', true); | |
resolve(); | |
}, 3000); | |
}); | |
return promise; | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Model from 'ember-data/model'; | |
import attr from 'ember-data/attr'; | |
import { belongsTo, hasMany } from 'ember-data/relationships'; | |
export default Model.extend({ | |
price: null, | |
name: null, | |
init(){ | |
this.set('price', null); | |
this.set('name', null); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import EmberRouter from '@ember/routing/router'; | |
import config from './config/environment'; | |
const Router = EmberRouter.extend({ | |
location: 'none', | |
rootURL: config.rootURL | |
}); | |
Router.map(function() { | |
this.route('myRoute'); | |
}); | |
export default Router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import MultipleItems from '../models/MultipleItems'; | |
export default Ember.Route.extend({ | |
model(){ | |
let model = MultipleItems.create(); | |
model.SetData(); | |
return model; | |
}, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.15.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js", | |
"ember": "3.4.3", | |
"ember-template-compiler": "3.4.3", | |
"ember-testing": "3.4.3" | |
}, | |
"addons": { | |
"ember-data": "3.4.2" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment