This article is a mirror article of machine translation, please click here to jump to the original article.

View: 2194|Reply: 1

[Angular] Angular 17 series (XVII) detects changes in @Input values

[Copy link]
Posted on 5/29/2024 4:13:30 PM | | | |
@Input(), @Output() in Angular and allows Angular to share data between the parent context and child directives or components.

How does the component detect changes in the input value? The previous solution reference is as follows:

Angular 9 series (VIII) updates the value of a child component by triggering an event via set
https://www.itsvse.com/thread-9267-1-1.html
In fact, changes in input values can be detected through the ngOnChanges method, which is called when any of the data-bound properties of the OnChanges directive changes, and defines ngOnChanges() to handle the change.

Documentation:The hyperlink login is visible.

Create a new HelloComponent with the following code:

Page code:

The parent AppComponent code is as follows:

The page code is as follows:

The renderings are as follows:



(End)




Previous:.NET/C# modifies the value of static static readonly
Next:ASP.NET Core 8 uses IExceptionHandler for global exception handling
 Landlord| Posted on 12/5/2024 2:14:16 PM |
angular bidirectional binding:The hyperlink login is visible.
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com