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 {ValidationMixin, validate} from "ember-cli-simple-validation/mixins/validate"; | |
| export default Ember.Component.extend(ValidationMixin, { | |
| nameValidation: validate("model.name") | |
| }); |
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 {ValidationMixin, validateEach} from "ember-cli-simple-validation/mixins/validate"; | |
| var isLegit = function(name) { | |
| return name && name.length > 3; | |
| }; | |
| export default Ember.Component.extend(ValidationMixin, { | |
| tagName: "ul", | |
| name: validateEach("name", isLegit), |
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' | |
| }); |
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 {ValidationMixin, validate} from "ember-cli-simple-validation/mixins/validate"; | |
| var isEven = function() { | |
| var value = this.get("model.even"); | |
| var number = parseInt(value, 10); | |
| return number && number % 2 === 0; | |
| }; | |
| export default Ember.Component.extend(ValidationMixin, { |
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
| 1) open a terminal | |
| 2) sudo alsa force-unload | |
| 3) wget https://dl.dropboxusercontent.com/u/716525/downloads/asound.state | |
| 4) cd /var/lib/alsa/ | |
| 5) cp ~/asound.state . | |
| 6) sudo !! | |
| 7) ls | |
| 8) sudo shutdown -r now | |
| A full video of me doing the steps shown above |
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 hbs from 'htmlbars-inline-precompile'; | |
| import {moduleForComponent, test} from 'ember-qunit'; | |
| moduleForComponent('user-defined', 'integration: user defined test', { | |
| integration: true, | |
| setup() { | |
| this.set('users', [{id: 3, name: '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 hbs from 'htmlbars-inline-precompile'; | |
| import {moduleForComponent, test} from 'ember-qunit'; | |
| moduleForComponent('user-defined', 'integration: user defined test', { | |
| integration: true, | |
| setup() { | |
| this.set('users', [{id: 3, name: '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 Ember from 'ember'; | |
| import hbs from 'htmlbars-inline-precompile'; | |
| var UserDefinedComponent = Ember.Component.extend({ | |
| layout: hbs` | |
| {{#each users as |user|}} | |
| {{#if custom}} | |
| {{component custom user=user}} | |
| {{else}} | |
| <h1>{{user.name}}</h1> |
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 hbs from 'htmlbars-inline-precompile'; | |
| var UserTableComponent = Ember.Component.extend({ | |
| layout: hbs` | |
| {{#each users as |user|}} | |
| <div>{{user.name}}</div> | |
| <button onclick={{action remove user.id}}>remove</button> | |
| {{/each}} | |
| ` |
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 hbs from 'htmlbars-inline-precompile'; | |
| import {moduleForComponent, test} from 'ember-qunit'; | |
| moduleForComponent('users-table', 'integration: users table test', { | |
| integration: true | |
| }); | |
| test('should fire action when button is clicked', function(assert) { | |
| assert.expect(1); | |
| this.set('remove', (id) => { |