Angular - Dis
Angular - Dis
with
Use the NgModel directive to display a data property and update that
imports list.
{ } '@angular∕forms'; ∕∕
<--- JavaScript import from Angular
∕* . . . *∕
@Component({
standalone: ,
∕* . . . *∕
imports: [
, ∕∕ <-- import into the
component
, ∕∕ <--- import into the
component
∕* . . . *∕
],
})
{
∕* . . . *∕
}
for="example-ngModel" [(ngModel)]:
[(ngModel)]="currentItem.name"
id="example-ngModel"
separates the property and event binding. Use property binding to set
src/app/app.component.html
[ngModel]="currentItem.name"
(ngModelChange)="setUppercaseName($event)"
id="example-uppercase"
COMMON BUILT-IN
DETAILS
STRUCTURAL DIRECTIVES
{ } '@angular∕common';
∕* . . . *∕
@Component({
standalone: ,
∕* . . . *∕
imports: [
, ∕∕ <-- import into the component
∕* . . . *∕
],
})
{
∕* . . . *∕
}
element.
src/app/app.component.html
*ngIf="isActive" [item]="item"
When the isActive expression returns a truthy value, NgIf adds the
For more information on NgIf and NgIfElse , see the NgIf API
documentation.