In this part, we will introduce Angular router and learn how it can update our application when the browser URL changes and vice versa. We will also learn how we can update our application to resolve data from our backend API using the router.
There’s one question that comes up again and again on stackoverflow. The question is about
ngDoCheck lifecycle hook that is triggered for a component that implements
OnPush change detection strategy. It’s usually formulated something like:
I have used
OnPushstrategy for my component and no bindings have changed, but the
ngDoChecklifecycle hook is still triggered. Is the strategy not working?
Angular CLI 1.3.0 is out with some nice new features!It now officially supports ES2017 and TypeScript 2.4 and is ready for Angular 5 (which should be out shortly).You can check out what files you need to update using angular-cli-diff, for example if you are currently using 1.2.1: angular-cli-diff/compare/1.2.1…1.3.0Let’s see what new features we have!
Angular has a concept of the running application instance that you can usually inject using
ApplicationRef token. There potentially can be many applications on one platform. Each application is created from the module using
bootstrapModule method. This is exactly the method that is used in
main.ts. So the statement shown in the docs first creates a platform and then the application instance.
Angular version 4.3.1 introduced one important new feature: the new HTTP client. Not only did it bring optimizations in how we can execute requests to backend APIs, but it made intercepting HTTP requests extremely easy.