Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Added form examples for form-input (#852)
* #677 Added example for using forms * lock experimentation * fixing package lock issue * #677 Updated description for form group input component documentation * #677 fixed minor formatting issue in documentation module
- Loading branch information
Showing
7 changed files
with
86 additions
and
30 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
docs/app/documentation/component-docs/form/examples/form-group-input-example.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,16 @@ | ||
<form [formGroup]="customForm"> | ||
<div fd-form-set> | ||
<div fd-form-item> | ||
<label fd-form-label for="input-1">Default Input:</label> | ||
<input | ||
formControlName="inputControl" | ||
fd-form-control | ||
type="text" | ||
id="input-1" | ||
placeholder="Field placeholder text" | ||
/> | ||
</div> | ||
</div> | ||
</form> | ||
|
||
Input Value: {{ customForm.controls.inputControl.value }} |
3 changes: 3 additions & 0 deletions
3
docs/app/documentation/component-docs/form/examples/form-group-input-example.component.scss
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,3 @@ | ||
input { | ||
margin-bottom: 10px; | ||
} |
13 changes: 13 additions & 0 deletions
13
docs/app/documentation/component-docs/form/examples/form-group-input-example.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,13 @@ | ||
import { Component } from '@angular/core'; | ||
import { FormGroup, FormControl, Validators } from '@angular/forms'; | ||
|
||
@Component({ | ||
selector: 'fd-form-group-input', | ||
templateUrl: './form-group-input-example.component.html', | ||
styleUrls: ['form-group-input-example.component.scss'] | ||
}) | ||
export class FormGroupInputExampleComponent { | ||
customForm = new FormGroup({ | ||
inputControl: new FormControl('', Validators.required) | ||
}); | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.