forked from angular/angular
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(docs-infra): Adding required and Transform Args into the usage a…
…nd documentation of input I# No commands remaining.
- Loading branch information
Showing
7 changed files
with
83 additions
and
6 deletions.
There are no files selected for viewing
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
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
7 changes: 7 additions & 0 deletions
7
...xamples/inputs-outputs/src/app/item-details-metadata/item-details-metadata.component.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<h2>Child component with @Input() metadata configurations</h2> | ||
|
||
<p> | ||
Today's item: {{item}} | ||
Item's Availability: {{itemAvailability}} | ||
</p> | ||
|
23 changes: 23 additions & 0 deletions
23
.../examples/inputs-outputs/src/app/item-details-metadata/item-details-metadata.component.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// #docplaster | ||
// #docregion use-input-metadata-required | ||
import { Component, Input } from '@angular/core'; // First, import Input | ||
// #enddocregion use-input-metadata-required | ||
// #docregion use-input-metadata-boolean-transform | ||
import { booleanAttribute } from '@angular/core'; // First, import booleanAttribute | ||
// #enddocregion use-input-metadata-boolean-transform | ||
@Component({ | ||
selector: 'app-item-detail-metadata', | ||
templateUrl: './item-details-metadata.component.html' | ||
}) | ||
|
||
|
||
export class ItemDetailMetadataComponent { | ||
// #docregion use-input-metadata-required | ||
@Input({required: true}) item!: string; // Second, decorate the property with required metadata | ||
// #enddocregion use-input-metadata-required | ||
|
||
// #docregion use-input-metadata-boolean-transform | ||
@Input({transform: booleanAttribute}) itemAvailability!: boolean; // Second, decorate the property with transform | ||
// #enddocregion use-input-metadata-boolean-transform | ||
} | ||
|
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
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
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