MUDOU?? CONSTRUTORES ANGULAR
#angular #javascript #injecaodependencia
Angular is a popular JavaScript framework for building web applications. With its powerful features and robust ecosystem, Angular has become a go-to choice for developers looking to create modern and complex web applications. One of the key concepts in Angular development is dependency injection, which allows for efficient and modular code organization.
One of the recent updates in Angular is the change in the way constructors are handled. In previous versions, constructors were explicitly defined with the “constructor” keyword. However, with the latest updates, Angular now uses a different syntax for defining constructors.
Here’s an example of the old constructor syntax:
class MyComponent {
constructor(private myService: MyService) {}
}
And here’s the new syntax for defining constructors in Angular:
class MyComponent {
constructor(private myService: MyService) {}
}
The new syntax may seem similar to the old one, but there are some important differences. It’s now possible to use TypeScript’s parameter properties, which allow for a more concise and readable code. Additionally, the new syntax better aligns with the overall direction of TypeScript and provides a more modern and streamlined approach to defining constructors.
Developers working with Angular will need to be aware of this change in constructor syntax, as it will impact the way they write and organize their code. However, the new syntax offers several advantages and can lead to more efficient and maintainable code in the long run.
In conclusion, the recent change in constructor syntax in Angular may require some adjustments for developers, but ultimately it reflects the framework’s commitment to staying modern and providing the best development experience possible.
Da para trocar o construtor pelo inject nas classes? porque nos guards e resolver feitos com função tem que usar o inject.
Faz um video de tudo sobre o rxjs pfv!!!!!!
conteudo muito top, estou aprendendo muito
Dicas top.
muito top mano, parabéns!
muito obrigado pelos seus videos Mestre, vlw mesmo
Muito bom mestre! Em outros exemplo mostra como seria numa aplicação "real", um caso de uso.
Fenomenal, faz mais vídeos nesse formato 🤜🏻🤛🏽
Muito bem explicado irmão! Excelente, continue assim sempre