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'; | |
| const {computed} = Ember; | |
| let aCount = 0; | |
| let bCount = 0; | |
| export default Ember.Controller.extend({ | |
| appName: 'Ember Twiddle', | |
| value: 'initial', | |
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
| /* | |
| notifying the store that a record has been remotely deleted and should be fully removed. | |
| */ | |
| function pushDeletion(store, type, id) { | |
| let record = store.peekRecord(type, id); | |
| if (record !== null) { | |
| let relationships = {}; | |
| let hasRelationships = 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.Controller.extend({ | |
| appName: 'Ember Twiddle', | |
| array: ['a', 'b', 'c'], | |
| lengthBased: Ember.computed('array.length', function() { | |
| return this.get('array').join(" "); | |
| }), | |
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({ | |
| didRender() { | |
| Ember.run.next(() => this.get('element').classList.add('animate')) | |
| } | |
| }); |
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'; | |
| // this is a bit of a weird construction, but it prevents duplicating the default | |
| // values in the controller and the route. It'd probably be possible to make a helper | |
| // here to make it a bit less weird. Or if default values are always null, this isn't necessary | |
| const ApplicationController = Ember.Controller.extend({ | |
| queryParams: ['statusId', 'caseId'] | |
| }); |
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({ | |
| appName: 'Ember Twiddle', | |
| myService: Ember.inject.service() | |
| }); |
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({ | |
| attributeBindings: ['id'], | |
| id: Ember.computed('foo', function() { | |
| if (this.get('foo')) { | |
| return 'bar'; | |
| } else { | |
| return null; | |
| } |
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'; | |
| let onceObserver = function(observerFunc, ...keys) { | |
| return Ember.observer(...keys, function() { | |
| Ember.run.once(this, observerFunc); | |
| }); | |
| } | |
| export default Ember.Controller.extend({ | |
| appName: 'Ember Twiddle', |
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({ | |
| appName: 'Ember Twiddle', | |
| links: [{params: ['Index Link', 'index']}, {params: ['Foo link', 'foo', '1']}] | |
| }); |
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({ | |
| appName: 'Ember Twiddle', | |
| myService: Ember.inject.service() | |
| }); |
NewerOlder