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({ | |
| classNameBindings: ['hasInitialized:some-class'], | |
| rendered: 0, | |
| hasInitialized: Ember.computed('random', function() { | |
| return true; | |
| }), | |
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({ | |
| isOn: true, | |
| didRender() { | |
| const videojs = this.element.querySelector('.videojs'); | |
| videojs.appendChild(this.element.querySelector('.custom-buttons')); | |
| }, | |
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({ | |
| isEven: Ember.computed('value', function() { | |
| return this.get('value') % 2 === 0; | |
| }) | |
| }); |
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 randInt = (min, max) => min + Math.round(Math.random() * (max - min)); | |
| export default Ember.Component.extend({ | |
| src: 'https://www.example.com', | |
| didRender() { | |
| this.injectIframe(); | |
| }, | |
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({ | |
| }); |
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({ | |
| text: 'Default text!' | |
| }); |
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({ | |
| header: 'This is a really long header that might occur at some point in the future you just never know', | |
| body: 'This is a really long body with a lot of content I hope you enjoy reading it. This is a really long body with a lot of content I hope you enjoy reading it. ', | |
| footer: 'This is a small footer', | |
| }); |
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'; | |
| import EmberObject, { | |
| observer | |
| } from '@ember/object'; | |
| export default Ember.Component.extend({ | |
| alertWhenMultipleOfFive: observer('observable.progress', function() { | |
| if (this.get('observable.progress') % 5 === 0) { | |
| alert('Child says progress was a multiple of 5!'); | |
| } |
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({ | |
| inappAlert: Ember.computed.readOnly('liveAlertsQueue.firstObject'), | |
| init() { | |
| this._super(...arguments); | |
| this.set('liveAlertsQueue', []); | |
| }, | |
| // This just fakes putting a queue on after the component is rendered |
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({ | |
| inAppAlert: Ember.computed.readOnly('inAppAlertQueue.firstObject'), | |
| init() { | |
| this._super(...arguments); | |
| this.set('inAppAlertQueue', [ | |
| 'hello', |