Created
March 13, 2019 03:33
-
-
Save rtablada/f23c95026ccd73f602b428c3e52b0e2d to your computer and use it in GitHub Desktop.
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 '@ember/component' | |
export default Component.extend({ | |
tagName: 'nav', | |
classNames: 'my-counter', | |
attributeBindings: ['data-test-selector'], | |
'data-test-selector': 'counter', | |
value: 0, // This could collide with an existing component property though 🤷🏽♂️ | |
actions: { | |
goUp() { | |
this.set('value', this.get('value') + 1); | |
} | |
} | |
}); |
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'; | |
export default class MyCounter extends Component { | |
@tracked value = 0; // No collisions since glimmer component only has a small number of methods/properties | |
goUp = () => this.value ++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment