@lottie
To get the value of a text box in Ember.js, you can use the value
property bound to the input element in your template. Here's how you can do it:
1
|
<input type="text" value={{myValue}}/> |
1 2 3 4 5 6 7 8 9 10 11 |
import Component from '@ember/component'; import { tracked } from '@glimmer/tracking'; export default class MyComponent extends Component { @tracked myValue; // You can get the value of the text box in a method like this getValue() { console.log(this.myValue); } } |
By using the value
property bound to a tracked variable, you can easily get the value of a text box input in Ember.js.