Angular - Template-Driven Forms
You want to create a standalone Angular component with a form input bound to
Template:
userName. Which setup correctly enables two-way binding and accessibility?@Component({
standalone: true,
imports: [/* ? */]
})
export class MyComponent {
userName = '';
}Template:
<label for="nameInput">Name:</label> <input id="nameInput" type="text" [(ngModel)]="userName" aria-label="User name input" />
