-
Notifications
You must be signed in to change notification settings - Fork 6.8k
feat(schematics): address form schematic #11425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
margin: 20px auto; | ||
} | ||
|
||
mat-radio-button { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be a css class instead of styling the element directly?
src/lib/schematics/collection.json
Outdated
@@ -30,6 +30,13 @@ | |||
"factory": "./nav/index", | |||
"schema": "./nav/schema.json", | |||
"aliases": [ "material-nav" ] | |||
}, | |||
// Creates a address form component | |||
"form": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be something like address-form
in case we want to add different forms later?
<mat-card-title>Shipping Information</mat-card-title> | ||
</mat-card-header> | ||
<mat-card-content> | ||
<table cellspacing="0" class="full-width"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be a table
because it's not showing tabular data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other examples used a table so I just carried that over here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which other examples? User-facing ones?
hasUnitNumber = false; | ||
|
||
states = [ | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Collapse entries like
{name: 'Alaska', abbreviation: 'AK'},
@jelbourn - Addressed feedback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
<mat-form-field class="full-width"> | ||
<input matInput placeholder="First name" formControlName="firstName"> | ||
<mat-error *ngIf="addressForm.controls['firstName'].hasError('required')"> | ||
First name is <strong>required</strong> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you can use addressForm.get('firstName').hasError('required')
or even better, IMHO: addressForm.hasError('required', ['firstName'])
.
@jelbourn - rebased. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
A address form schematic
Demo: https://stackblitz.com/edit/shipping-form