You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a .ts file with a class that reprensents the component
Use the @Component decorator to mark to angular that the class reprensents a component and configure the selector, the template, the style, and the fact that it is standalone
Create an html and css files and add their path to the component decorator
We then saw how to use the cli to create it
ng g c components/comp-name
Using the signal based component APIs
Angular 18 comes with new ways to define communicatio between components
We saw how to define an input using the input function.
We saw how to make it mandatory using the input.required function.
We saw how to define an output using the output function.
We saw how to define a pair of input and output for the same data using the model function.
We saw how to make it mandatory using the model.required function
Finally, we saw that we can use it seperatly, as input, as output or as two way bounded signal using the syntaxes:
<!-- Assuming value is a writeable signal --><app-comp[data]="value()"/><app-comp(dataChange)="value.set($event)"/><app-comp[(data)]="value">
Immutable data types
We talked about working with immutable data types
We saw how to create them using readonly properties on interfaces
We saw why it is important to use interfaces and not classes