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'; | |
class Item { | |
@tracked count; | |
constructor(content, count) { | |
this.content = content; | |
this.count = count; | |
} |
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'; | |
} |
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 AnimationSimpleDivDrag extends Controller { | |
// initialise grid properties | |
dragCardPositionDelta = { dx: 0, dy: 0 }; | |
isDraggingCard = false; | |
constructor(...args) { | |
super(...args); |
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 { setOwner } from '@ember/application'; | |
import { inject as service } from '@ember/service'; | |
export default class MyClass { | |
@service myService; | |
constructor(owner) { | |
setOwner(this, owner); | |
this.appName = this.myService.appName; | |
} |
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 { guidFor } from '@ember/object/internals'; | |
export default class extends Component { | |
elementId = null; | |
constructor() { | |
super(...arguments); | |
this.elementId = guidFor(this); |
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'; | |
import { tracked } from '@glimmer/tracking'; | |
import 'mapbox-gl'; | |
const center = {lng: 79.3832, lat: 43.6532}; | |
function generateModel() { | |
return Array(3).map(pt => ({ | |
lng: center.lng + Math.random() / 10, |
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'; | |
import { tracked } from '@glimmer/tracking'; | |
export default class ApplicationController extends Controller { | |
appName = 'Ember Twiddle'; | |
@tracked | |
fruits = [ | |
'apples', |
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 | |
onRouteChange() { | |
console.log('changing route'); | |
} |
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'; | |
theColor = 'red'; | |
} |
NewerOlder