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.Component.extend({ | |
isCheap: Ember.computed.lt('itemMasterPrice', 5), | |
listLength: Ember.computed('itemList.[]', function() { | |
return this.get('itemList').length; | |
}), | |
itemPrices: Ember.computed.mapBy('itemList', 'price'), | |
mostExpensive: Ember.computed.max('itemPrices'), | |
isFeatured: Ember.computed.filter('itemList', function(item) { |
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', | |
simpleYears: Ember.computed('newsletters', function() { | |
const years = [2015, 2015, 2015] | |
console.log(years) | |
return years | |
.map(item => item) | |
.uniq() |
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'; | |
const { run } = Ember; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
actions: { | |
onSearch(term) { | |
//Uncomment this to see it work right | |
//run.cancel(this.get('timer')) |
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 GiphyClient from '../lib/giphy-client'; | |
const { Component, computed, get, set, isBlank } = Ember; | |
const GIPHY_DEBOUNCE = 1000; | |
export default Component.extend({ | |
init() { | |
this._super(...arguments); |
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'; | |
import { readOnly } from '@ember/object/computed'; | |
export default Ember.Component.extend({ | |
tagName: 'a', | |
classNames: [ | |
'text-yellow-dark', | |
'no-underline', | |
'mr-6' |
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'; | |
import { readOnly } from '@ember/object/computed'; | |
export default Ember.Component.extend({ | |
tagName: 'a', | |
classNames: ['mediaCard__link'], | |
attributeBindings: ['href'], | |
href: readOnly('url') | |
}); |
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'; | |
import { readOnly } from '@ember/object/computed'; | |
export default Ember.Component.extend({ | |
tagName: 'a', | |
classNames: ['link'], | |
attributeBindings: ['href'], | |
href: readOnly('url') | |
}); |
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'; | |
const { run: { later } } = Ember; | |
export default Ember.Controller.extend({ | |
greeting: 'Hallo', | |
actions: { | |
search(value) { | |
//This would be requesting the ember-data resource | |
later(null, () => { | |
Ember.set(this, 'model', value); |
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'; | |
import { readOnly } from '@ember/object/computed'; | |
export default Ember.Component.extend({ | |
tagName: 'a', | |
classNames: ['mediaCard__link', 'site-linkColor'], | |
attributeBindings: ['href'], | |
href: readOnly('url') | |
}); |
OlderNewer