Рет қаралды 6,587
Starting with Angular v16.1, we can now transform data using the @Input() decorator.
The @Input() decorator identifies an input property. We can use an input property to receive a value from a parent component. Or read a route from the URL.
The @Input() decorator provides three additional feature options for our input properties: alias, required (v16), and transform (v16.1). This video briefly describes the first two, then focuses on data transformation.
*Content*
00:00 The @Input() decorator
02:15 Alias the input property name
03:37 Require an input property
04:33 Transform a value before assigning it
05:44 Create a reusable transform function
05:55 Built-in transform functions
06:21 Using the booleanAttribute transform function
07:51 Using the numberAttribute transform function
08:23 Sample code
*Links*
KZbin video "Use @Input() to Read Route Parameters in Angular": kzbin.info/www/bejne/hKban2irjp14itk
GitHub source code: github.com/DeborahK/Angular-Experiments/tree/main/apm-parent-child
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
😊About Me
Hey! I'm Deborah Kurata
I love teaching and creating content for developers! I create KZbin videos and write articles for freeCodeCamp. And I'm a Pluralsight author with courses in the top 10 most popular (out of 10,000+) over the past 5 years.
For my work in support of software developers, I've been recognized with the Microsoft Most Valuable Professional (MVP) award in Developer Technologies, and I'm a Google Developer Expert (GDE) in Angular.
Contact me on Twitter: DeborahKurata
Find my Pluralsight courses: www.pluralsight.com/profile/author/deborah-kurata
Access my freeCodeCamp articles: www.freecodecamp.org/news/author/deborah-kurata/
View my KZbin content: www.youtube.com/@deborah_kurata
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
#angular #bestpractices #angulartutorial #demo
#angularparentchild #componentcommunicationinAngular #angularcomponentcommunication #componentinteractionAngular #componenttocomponentcommunicationinAngular #componentinteractioninAngular #passingdatafromcomponenttocomponentangular