-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix/derived-from-undefined-initial-value
- Loading branch information
Showing
141 changed files
with
3,105 additions
and
677 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
49 changes: 49 additions & 0 deletions
49
apps/test-app/src/app/form-events/form-events.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,49 @@ | ||
import { AsyncPipe, JsonPipe } from '@angular/common'; | ||
import { Component, inject } from '@angular/core'; | ||
import { | ||
NonNullableFormBuilder, | ||
ReactiveFormsModule, | ||
Validators, | ||
} from '@angular/forms'; | ||
import { allEventsObservable, allEventsSignal } from 'ngxtension/form-events'; | ||
|
||
@Component({ | ||
selector: 'ngxtension-platform-intl', | ||
standalone: true, | ||
imports: [ReactiveFormsModule, JsonPipe, AsyncPipe], | ||
template: ` | ||
<form [formGroup]="form"> | ||
<label for="firstName">First Name</label> | ||
<input formControlName="firstName" name="firstName" /> | ||
@if (form.controls.firstName.errors?.['required']) { | ||
<p>First name is required</p> | ||
} | ||
<label for="lastName">Last Name</label> | ||
<input formControlName="lastName" name="lastName" /> | ||
<br /> | ||
<button type="reset">Reset</button> | ||
</form> | ||
<pre>{{ $form() | json }}</pre> | ||
<pre>{{ form$ | async | json }}</pre> | ||
`, | ||
}) | ||
export default class FormEventsComponent { | ||
fb = inject(NonNullableFormBuilder); | ||
form = this.fb.group({ | ||
firstName: this.fb.control('', Validators.required), | ||
lastName: this.fb.control(''), | ||
}); | ||
|
||
form$ = allEventsObservable(this.form); | ||
$form = allEventsSignal(this.form); | ||
|
||
formTyped$ = allEventsObservable<ReturnType<typeof this.form.getRawValue>>( | ||
this.form, | ||
); | ||
$formTyped = allEventsSignal<ReturnType<typeof this.form.getRawValue>>( | ||
this.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
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,6 @@ | ||
{ | ||
"name": "Lorenzo D'Ianni", | ||
"twitter": "https://x.com/lorenzodianni", | ||
"linkedin": "https://www.linkedin.com/in/lorenzo-d-ianni-3990bba6/", | ||
"github": "https://github.com/lorenzodianni" | ||
} |
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,3 +1,5 @@ | ||
{ | ||
"name": "Lucas Garcia" | ||
"name": "Lucas Garcia", | ||
"twitter": "https://x.com/LcsGa_", | ||
"github": "https://github.com/LcsGa" | ||
} |
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,6 @@ | ||
{ | ||
"name": "Michael Berger", | ||
"twitter": "https://x.com/mikelgo812", | ||
"github": "https://github.com/mikelgo", | ||
"website": "https://www.berger-engineering.io/" | ||
} |
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
Oops, something went wrong.