IONIC Section 4 - 4.18 Why Angular ?
Click here for more videos available on our youtube channel !Hello everyone, so in this module we learned a lot about the basic Ionic components, we learned that the official documentation is the ideal place to know everything, all the possible configurations, because it is impossible to memorize them in their entirety, you'll learn them in more detail with practice, so it's only natural for you to review documentation first before starting your design. Now let's see together why use Angular at this time? To be more precise, there are 3 main reasons for which we will use Angular, because doing everything by yourself is all the longer and more complicated, especially if we have more complex logic. We don't want to reinvent the wheel of implementations, we don't want to access the DOM on our own, we just want to control how our DOM should change, data that should be output, such as a list of products. We don't want to worry about logic real output, we only want to control the logic, like add product, validate input products, fetching them from a server is what we want to do. We also do not want to manage the state ourselves, because state management in larger applications can be very difficult, as it allows to pass data correctly and to update different parts of the application when some data has changed elsewhere. And Angular makes this easier with the help of its services. So to prevent our UI from behaving in such a way unpredictable and our app has a lot of bugs. We definitely want to use a state management system like the one offered by Angular, its services and dependency injection, which also affects the alert controller and so on. You remember the "ion-alert" component that we placed in our HTML code and then have access via our JS file in order to be able to create it? Well with Angular and Ionic, we can simply inject this alert controller, thanks to the wrapper package that Ionic provides us around the essential components. This then facilitates the use of these components, so that we no longer need to focus on adding and selecting with the query selector but on doing that we can just inject it and start using it. /TAP5/ Finally, if our application requires several pages because For our budget plan example, we only have one page, we don't navigate, we don't press the “Previous” button to return to a previous page. In much more complete applications, you have different pages, several tabs, several parts of the application differed by a list of products, the profile of the user or other. This routing could be done with Ionic, it has its own Routing component, but Angular's Routing is much more powerful, it gives us a lot of advanced features and smart Routing, for correct routing where we can also work with things like query parameters in the URL etc. That's why we use Angular, because it helps us with complex logic, because we can focus on writing the logic and Angular does the rest of the DOM update, it gives us clear rules about how to structure your application with components, directives, services. And so on, so that we have a clear plan for building a larger application. He helps us for the services, links and routing to the transport state and tells us about routing. It also helps us with data transfer, painful loading etc… This is why we will use Angular from the next section and I will show you in detail how to set up an Angular and Ionic project. We have had occasion to do this before. I'll meet you in the next video about our next section.