Introducción a Angular y Fundamentos
Aprende Angular 17
Creando tu primer proyecto en Angular
Implementando estilos
Mostrando elementos
Property Binding en Angular
Event Binding: click y doble click
Event binding: keydown
Modelo de reactividad con Signals
Creando un Signal en Angular
Estructuras de control en Angular
Directivas de control
Uso de ngFor
ngFor para objetos
Update Tasks
Uso de ngIf
Uso de ngSwitch y ngSwitchDefault
Controlando un input
Manejo de formularios en Angular
Alistando tu aplicación para producción
Estilos al modo Angular
Clases en Angular
Editing mode
Estados compuestos con computed
Usando effect para localStorage
Uso de ngbuild
Despliegue con Firebase Hosting
Nueva sintaxis en Angular
Directivas @For, @switch
Migrando a la nueva sintaxis de Angular v17
Componentes Reutilizables y Comunicación
Construyendo un e-commerce en Angular
Componentes en Angular
Mostrando los componentes
Angular DevTools
Uso de Inputs en Angular
Uso de Outputs en Angular
Componentes para Producto
Ciclo de vida de los componentes
Ciclo de vida de componentes
Ciclo de vida de componentes: ngOnChanges
Ciclo de vida de componentes: ngOnInit
Detectando cambios en los inputs
Evitando memory leaks con ngDestroy
Audio player con ngAfterViewInit
Creando la página "about us" o "conócenos"
Mejorando la interfaz del producto
Creando componente de productos
Creando el Header
Creando el carrito de compras
Comunicación padre e hijo
Calculando el total con ngOnChanges
El problema del prop drilling
Reactividad con signals en servicios
Entendiendo la inyección de dependencias
Integración y Datos
Obteniendo datos una REST API
Importaciones cortas en Typescript
Pipes en Angular
Construyendo tu propio pipe
Utilizando librerías de JavaScript en Angular
Conociendo las directivas
Deployando un proyecto en Vercel
Enrutamiento y Navegación
Ruta 404
Uso del RouterLink
Vistas anidadas
Uso del RouterLinkActive
Detalle de cada producto
Obteniendo datos del producto
Galería de imagenes
Detalle de la galería
Perfeccionando tu e-commerce
Mostrando categorias desde la API
Url Params
LazyLoading y Code Splitting
Aplicando LazyLoading
Prefetching
Usando la nueva sintaxis de Angular 17
Lanzando tu aplicación a producción
You don't have access to this class
Keep learning! Join and start boosting your career
Control structures are essential tools in programming that allow us to manage the execution flow of a program. In Angular, these structures are crucial for displaying elements dynamically, including, for example, rendering lists based on specific conditions. Using these structures allows our applications to better adapt and respond to the current state of the data.
The concept of signals in Angular is fundamental when it comes to obtaining and handling dynamic values. A signal is a dynamic reference to a value that can be a string
or another type of data such as an array. Using signals allows developers to subscribe to these values and get updates whenever the value changes. Thus, we can create more reactive and efficient applications.
// We convert an array of tasks into a signalconst tasks = signal(['Task 1', 'Task 2', 'Task 3']);
To work with the value of a signal, it is necessary to subscribe to it. This is done by executing the signal, which allows us to access the stored value.
To iterate over an array in Angular, the ngFor
directive is commonly used. This allows us to not only iterate through the elements of the array, but also to obtain additional information, such as the index of each element within the array.
<!-- Iterating an array using ngFor --><li*ngFor="let task of tasks(); index as i"> {{ i }}: {{ task }}</li>
Here we iterate over each element of the tasks
signal, printing both its index and value. This is especially useful for rendering lists of dynamic elements.
Task list applications typically display several tasks in different states. These states can be:
To handle these different presentations of a task, you could work with a part of the visual HTML and adjust the status of each task as needed.
<div*ngIf="task.state === 'visualization'"> <span>{{ task.label }}</span></div>.
Implementing using Angular and signals allows for a smooth and efficient user experience, as status updates are rendered in real time.
Commenting out parts of the code is a common technique to prevent the execution of certain aspects of the code while working on others. This allows:
<!-- Section commenting in HTML --><!-- <div> This is temporarily commented out </div> -->
This technique helps the developer to more efficiently manage their project as it expands and becomes more complicated.
The points covered here represent only a fraction of what can be accomplished with Angular and its flow control and dynamic rendering capabilities. Continuing to explore and learn more about these technologies will allow you to build robust and highly interactive applications. Go ahead and continue your journey in web development with Angular!
Contributions 18
Questions 5
All my tasks in one place
<input class="new-todo" placeholder="Type new todo" autofocus type="text" />✅
Want to see more contributions, questions and answers from the community?