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 Controller from '@ember/controller'; | |
import { action } from '@ember/object'; | |
export default class ApplicationController extends Controller { | |
appName = 'Ember Twiddle'; | |
@action | |
hi() { | |
alert('hi'); | |
} |
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 Controller from '@ember/controller'; | |
export default class ApplicationController extends Controller { | |
appName = 'Ember Twiddle'; | |
yo(event) { | |
console.log(event); | |
} | |
} |
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 Controller from '@ember/controller'; | |
export default class ApplicationController extends Controller { | |
appName = 'Ember Twiddle'; | |
yo(event) { | |
console.log(event); | |
} | |
} |
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 Controller from '@ember/controller'; | |
import { tracked } from '@glimmer/tracking'; | |
import { action } from '@ember/object'; | |
export default class ApplicationController extends Controller { | |
@tracked isHovering; | |
@action | |
handleHover() { | |
this.isHovering = !this.isHovering; |
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 Component from '@glimmer/component'; | |
import { tracked } from '@glimmer/tracking'; | |
import { computed } from '@ember/object'; | |
export default class extends Component { | |
@tracked array = [1, 2, 3, 4, 5]; | |
// @computed('array') | |
get evens() { | |
console.log('evens called'); |
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 Controller from '@ember/controller'; | |
import { action, computed } from '@ember/object'; | |
export default class ApplicationController extends Controller { | |
firstName = 'David'; | |
lastName = 'Tang'; | |
@computed('firstName', 'lastName') | |
get fullName() { | |
return `${this.firstName} ${this.lastName}`; |
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 Controller from '@ember/controller'; | |
import { tracked } from '@glimmer/tracking'; | |
import { action } from '@ember/object'; | |
export default Controller.extend({ | |
appName: tracked({ value: 'Gmail' }), | |
handleClick: action(function() { | |
this.appName = 'AuditBoard'; | |
}) |
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 { A } from '@ember/array'; | |
import EmberObject, { computed } from '@ember/object'; | |
import Controller from '@ember/controller'; | |
export default Controller.extend({ | |
todos: null, | |
init() { | |
this._super(...arguments); | |
this.set('todos', A([ |
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 Controller from '@ember/controller'; | |
import { and, or } from '@ember/object/computed'; | |
export default Controller.extend({ | |
isA: 'true', | |
isB: and('isA'), | |
actions: { | |
updateProperty(property) { |
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 Controller from '@ember/controller'; | |
import { action, computed } from '@ember/object'; | |
import { tracked } from '@glimmer/tracking'; | |
export default class ApplicationController extends Controller { | |
@tracked firstName = 'David'; | |
@tracked lastName = 'Tang'; | |
get fullName() { | |
return `${this.firstName} ${this.lastName}`; |
NewerOlder