Content was moved here: https://github.com/Selleo/selleo_best_practices/blob/master/service_delivery_paths/frontend_developer/frameworks/emberjs.md
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: { | |
add() { | |
const { title, calories } = this; | |
this.db.recipes.add({ title, calories: parseInt(calories) }).then(() => { | |
this.db.table("recipes") | |
.orderBy("calories") |
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 { computed } from '@ember/object'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
label: '', | |
hashCode(str) { | |
let hash = 0; | |
for (let i = 0; i < str.length; i++) { |
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 { computed } from '@ember/object'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
test: computed('{bla,la}', function() { | |
return `${this.bla},${this.la}`; | |
}), | |
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({ | |
}); |
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 { task, timeout } from 'ember-concurrency'; | |
import { isBlank } from '@ember/utils'; | |
const DEBOUNCE_MS = 250; | |
const API_URL = 'https://api.github.com/search/users?q='; | |
export default Ember.Component.extend({ | |
searchUsers: task(function * (term) { | |
if (isBlank(term)) { return []; } |
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', | |
value: `<div> | |
<p><span style="font-weight: bold;">Type: </span> exploration, adventure</p> | |
<br> | |
<p><span style="font-weight: bold;">Audio: </span> English</p> | |
</div>`, | |
pellOptions: { |
NewerOlder