-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support translate title of properties in validation errors
- Loading branch information
1 parent
6c7fa3c
commit dbba241
Showing
33 changed files
with
1,493 additions
and
327 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
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
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
78 changes: 39 additions & 39 deletions
78
apps/demo/src/app/pages/experimental-page/experimental-page.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 |
---|---|---|
@@ -1,41 +1,41 @@ | ||
<div | ||
class="experimental-page" | ||
fxLayout.gt-md="row" | ||
fxLayout.lt-md="column" | ||
fxLayoutAlign="space-evenly stretch" | ||
fxLayoutAlign.lt-md="center"> | ||
<div | ||
fxFlex.gt-sm="50"> | ||
<ngx-docs-example | ||
title="Experimental: user panel" | ||
[html]="source.html" | ||
[ts]="source.ts" | ||
[launch]="source.launch"> | ||
<div class="body"> | ||
<exp-user-panel></exp-user-panel> | ||
</div> | ||
</ngx-docs-example> | ||
<ngx-docs-example | ||
title="Experimental: login panel" | ||
[html]="loginSource.html" | ||
[ts]="loginSource.ts" | ||
[launch]="loginSource.launch"> | ||
<div class="body"> | ||
<exp-login-panel></exp-login-panel> | ||
</div> | ||
</ngx-docs-example> | ||
<ngx-docs-example | ||
title="Experimental: registration panel" | ||
[html]="registrationSource.html" | ||
[ts]="registrationSource.ts" | ||
[launch]="registrationSource.launch"> | ||
<div class="body"> | ||
<exp-registration-panel></exp-registration-panel> | ||
</div> | ||
</ngx-docs-example> | ||
</div> | ||
<source-tabs | ||
title="Other files" | ||
[files]="otherFiles" | ||
fxFlex.gt-sm="50"></source-tabs> | ||
class="experimental-page" | ||
fxLayout.gt-md="row" | ||
fxLayout.lt-md="column" | ||
fxLayoutAlign="space-evenly stretch" | ||
fxLayoutAlign.lt-md="center" | ||
> | ||
<div fxFlex.gt-sm="50"> | ||
<ngx-docs-example | ||
title="{{ 'Experimental: user panel' | transloco }}" | ||
[html]="source.html" | ||
[ts]="source.ts" | ||
[launch]="source.launch" | ||
> | ||
<div class="body"> | ||
<exp-user-panel></exp-user-panel> | ||
</div> | ||
</ngx-docs-example> | ||
<ngx-docs-example | ||
title="{{ 'Experimental: login panel' | transloco }}" | ||
[html]="loginSource.html" | ||
[ts]="loginSource.ts" | ||
[launch]="loginSource.launch" | ||
> | ||
<div class="body"> | ||
<exp-login-panel></exp-login-panel> | ||
</div> | ||
</ngx-docs-example> | ||
<ngx-docs-example | ||
title="{{ 'Experimental: registration panel' | transloco }}" | ||
[html]="registrationSource.html" | ||
[ts]="registrationSource.ts" | ||
[launch]="registrationSource.launch" | ||
> | ||
<div class="body"> | ||
<exp-registration-panel></exp-registration-panel> | ||
</div> | ||
</ngx-docs-example> | ||
</div> | ||
<source-tabs title="{{ 'Other files' | transloco }}" [files]="otherFiles" fxFlex.gt-sm="50"></source-tabs> | ||
</div> |
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
62 changes: 23 additions & 39 deletions
62
apps/demo/src/app/panels/exp-login-panel/exp-login-panel.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 |
---|---|---|
@@ -1,40 +1,24 @@ | ||
<form | ||
[formGroup]="form" | ||
*ngIf="form?.customValidateErrors | async as errors" | ||
novalidate> | ||
<h3>Group form</h3> | ||
<mat-form-field class="full-width"> | ||
<input | ||
matInput | ||
formControlName="username" | ||
placeholder="Username"> | ||
<mat-error *ngIf="errors?.username?.length">{{errors?.username[0]}}</mat-error> | ||
</mat-form-field> | ||
<mat-form-field class="full-width"> | ||
<input | ||
matInput | ||
type="password" | ||
formControlName="password" | ||
placeholder="Password"> | ||
<mat-error *ngIf="errors?.password?.length">{{errors?.password[0]}}</mat-error> | ||
</mat-form-field> | ||
<div class="full-width"> | ||
<p>Form status: {{ form.status | json }}</p> | ||
<p> | ||
Form class-validator errors: {{errors|json}} | ||
</p> | ||
<p> | ||
Form native errors: {{form?.nativeValidateErrors|async|json}} | ||
</p> | ||
<p *ngIf="savedItem">Login user data: {{savedItem|json}}</p> | ||
</div> | ||
<div class="full-width"> | ||
<button | ||
mat-raised-button | ||
(click)="onLoginClick()" | ||
[disabled]="!form.valid" | ||
cdkFocusInitial> | ||
Login | ||
</button> | ||
</div> | ||
<form [formGroup]="form" *ngIf="form?.customValidateErrors | async as errors" novalidate> | ||
<h3>{{ 'Login form' | transloco }}</h3> | ||
<mat-form-field class="full-width"> | ||
<!--t(username)--> | ||
<input matInput formControlName="username" [placeholder]="'Username' | transloco" /> | ||
<mat-error *ngIf="errors?.username?.length">{{ errors?.username[0] }}</mat-error> | ||
</mat-form-field> | ||
<mat-form-field class="full-width"> | ||
<!--t(password)--> | ||
<input matInput type="password" formControlName="password" [placeholder]="'Password' | transloco" /> | ||
<mat-error *ngIf="errors?.password?.length">{{ errors?.password[0] }}</mat-error> | ||
</mat-form-field> | ||
<div class="full-width"> | ||
<p>{{ 'Form status:' | transloco }} {{ form.status | json }}</p> | ||
<p>{{ 'Form class-validator errors:' | transloco }} {{ errors | json }}</p> | ||
<p>{{ 'Form native errors:' | transloco }} {{ form?.nativeValidateErrors | async | json }}</p> | ||
<p *ngIf="savedItem">{{ 'Login user data:' | transloco }} {{ savedItem | json }}</p> | ||
</div> | ||
<div class="full-width"> | ||
<button mat-raised-button (click)="onLoginClick()" [disabled]="!form.valid" cdkFocusInitial> | ||
{{ 'Login' | transloco }} | ||
</button> | ||
</div> | ||
</form> |
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
Oops, something went wrong.