I am not getting the right result when trying to follow the Ember interactivity: Events, classes and state module. The module asks you to tell ember to create a header.js
class file and put the following in it:
import Component from ‘glimmer/component’;
import { action } from ‘ember/object’;
export default class HeaderComponent extends Component {
action
onKeyDown({ target, key }) {
let text = target.value.trim();
let hasValue = Boolean(text);
if (key === 'Enter' && hasValue) {
alert(text);
target.value = ''
}
}
}
When you go to the webpage that your are serving locally, you should be able to type text and hit enter. Then an alert should show the text you typed. No alert is happening for me. I am working in visual studio code and it gives me the following error
Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning.
I'm not sure if that is related. Here is the link to my code so far on GitHub. The only thing I've tried is going back through the tutorial to see if I skipped anything. Could you tell my if skipped a step or incorrectly implemented what the module tells you to do? I have removed the 'at' symbols from the example code on here because I think they were being treated like mentions.