Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
@angular/forms
Advanced tools
The @angular/forms package is a part of the Angular framework that provides tools for creating and managing forms in Angular applications. It offers two approaches: Reactive Forms and Template-driven Forms, which allow developers to handle user input and form validation in a robust and scalable way.
Reactive Forms
Reactive Forms provide a model-driven approach to handling form inputs whose values change over time. This feature allows for more flexible, scalable, and testable forms.
import { ReactiveFormsModule } from '@angular/forms';
@NgModule({
imports: [
// other imports ...
ReactiveFormsModule
],
})
export class AppModule { }
Template-driven Forms
Template-driven Forms are useful for adding simple forms to your app with minimal setup. They are less flexible than Reactive Forms but can be easier to use for basic scenarios.
import { FormsModule } from '@angular/forms';
@NgModule({
imports: [
// other imports ...
FormsModule
],
})
export class AppModule { }
Form Validation
The package provides built-in validators as well as the ability to create custom validators, making it easy to implement complex validation logic for form fields.
import { FormControl } from '@angular/forms';
let email = new FormControl('', [Validators.required, Validators.email]);
Form Groups
Form Groups are used to group together multiple form controls into one object, allowing for easier management of form data and validation.
import { FormGroup, FormControl } from '@angular/forms';
let userForm = new FormGroup({
firstName: new FormControl(),
lastName: new FormControl(),
age: new FormControl()
});
React Hook Form is a library for React that enables the management of forms with minimal re-renders. It is similar to @angular/forms in providing form validation and form state management, but it is designed specifically for React and uses hooks.
Formik is another popular form library for React. It simplifies the process of building, validating, and handling forms. It is comparable to @angular/forms in its functionality but is tailored to the React ecosystem.
Redux Form leverages Redux for form state management in React applications. It is similar to @angular/forms in that it handles form state and validation, but it integrates tightly with Redux for state management.
The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.
Usage information and reference details can be found in Angular documentation.
License: MIT
17.0.6 (2023-12-06)
| Commit | Type | Description | | -- | -- | -- | | a2e5f483f5 | fix | generate proper code for nullish coalescing in styling host bindings (#53305) |
| Commit | Type | Description | | -- | -- | -- | | 66ecf4c274 | fix | add compiler option to disable control flow content projection diagnostic (#53387) | | 74e6ce5d23 | fix | add diagnostic for control flow that prevents content projection (#53387) | | 6ec7a42b95 | fix | avoid conflicts with built-in global variables in for loop blocks (#53319) |
| Commit | Type | Description |
| -- | -- | -- |
| 0a53f96094 | fix | cleanup signal consumers for all views (#53351) |
| 4fc1581bbc | fix | handle hydration of multiple nodes projected in a single slot (#53270) |
| 14e66533ec | fix | support hydration for cases when content is re-projected using ng-template (#53304) |
| 8e366e8911 | fix | support swapping hydrated views in @for
loops (#53274) |
| Commit | Type | Description | | -- | -- | -- | | 45064f1ae1 | fix | CF migration - ensure NgIfElse attributes are properly removed (#53298) | | a6275cfa54 | fix | CF Migration - Fix case of aliases on i18n ng-templates preventing removal (#53299) | | 58a96e0f50 | fix | CF Migration add support for ngIf with just a then (#53297) | | 26e40c7f89 | fix | CF Migration fix missing alias for bound ngifs (#53296) | | 836aeba01d | fix | Change CF Migration ng-template placeholder generation and handling (#53394) | | 72d22ba7ee | fix | fix regexp for else and then in cf migration (#53257) | | 7a2facae8a | fix | handle aliases on bound ngIf migrations (#53261) | | 5104a89b30 | fix | handle nested ng-template replacement safely in CF migration (#53368) | | 2a4e3f5373 | fix | handle templates outside of component in cf migration (#53368) | | 0db75ab5b1 | fix | remove setting that removes comments in CF migration (#53350) |
| Commit | Type | Description | | -- | -- | -- | | 13ade13a15 | fix | Ensure canMatch guards run on wildcard routes (#53239) |
<!-- CHANGELOG SPLIT MARKER --><a name="17.0.5"></a>
FAQs
Angular - directives and services for creating forms
The npm package @angular/forms receives a total of 2,322,446 weekly downloads. As such, @angular/forms popularity was classified as popular.
We found that @angular/forms demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.