This file contains hidden or 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({ | |
vehicleType:"Car", | |
numWheels: Ember.on('init',Ember.computed('vehicleType',function(){ | |
if(this.get('vehicleType') === 'Car'){ | |
this.set('numWheels',4); | |
} |
This file contains hidden or 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({ | |
isProfilePageShown: Ember.computed('eUsername', function(){ | |
if(this.get('eUsername')){ | |
return true; | |
} | |
else{ | |
return false; | |
} |
This file contains hidden or 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({ | |
optionArr: Ember.computed('optionIndex', function() { | |
var arr = [false, false, false]; | |
arr[this.optionIndex] = true; | |
return arr; | |
}), | |
}); |
This file contains hidden or 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 $ from 'jquery'; | |
// import Promise from 'rsvp'; | |
import DS from 'ember-data'; | |
export default DS.Adapter.extend({ | |
findRecord(store, type, id, snapshot) { | |
return {'imgURL': 'New Img comes here'}; | |
}, |
This file contains hidden or 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 $ from 'jquery'; | |
// import Promise from 'rsvp'; | |
import DS from 'ember-data'; | |
export default DS.Adapter.extend({ | |
findRecord(store, type, id, snapshot) { | |
return {'imgURL': 'New Img comes here'}; | |
}, |
This file contains hidden or 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({ | |
cStore: Ember.inject.service('store'), | |
profileData: null, | |
myPic: Ember.computed.readOnly('profileData.profilePic'), | |
init(){ | |
this._super(...arguments); |
This file contains hidden or 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({ | |
actions: { | |
circleClicked() { | |
alert('Circle was clicked!'); | |
return false; | |
} | |
} | |
}); |
This file contains hidden or 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
// Mixin | |
import { task } from 'ember-concurrency'; | |
import Mixin from '@ember/object/mixin'; | |
export default Mixin.create({ | |
computedTask(keyToWatch, genFunc) { | |
// Maybe check if this wasn't previously set up | |
// Ready the task |
This file contains hidden or 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 funcSpecial from '../utils/my-special-func'; | |
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
foo: 123, | |
newFoo: funcSpecial(this, 'foo') | |
}); |
This file contains hidden or 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 Controller from '@ember/controller'; | |
import { tracked } from '@glimmer/tracking'; | |
import { action } from '@ember/object'; | |
import { A } from '@ember/array'; | |
import { set } from '@ember/object'; | |
class Age { | |
@tracked value; | |
OlderNewer