Angular Dependency Injection Project coding — Hierarchical DI
As we already mentioned in our introduction Angular Dependency Injection | Sample App | Tutorial, in this mini-website project implementation we will cover few important topics like Hierarchical DI, Console & http Logger, provider usage etc. incrementally as we keep on improving our website. All these topics are very neatly explained one by one in our subsequent Demo coding sessions.
In our first angular coding session Angular Coding Session Learn Dependency Injection | Practical | 1/8, we will cover Hierarchical DI. In this, we will create one service per line item and will inject them per component to see how it behaves, whether it is really independent per component or not. We will also consider one global service which will be registered at root level called as Order service let’s say. We will learn how to use behavior subject as state management policy, let’s say I want to manage the state of all line items so that when I change one line item I end up updating component itself, will see how to use behavior subject for this. Will also see how communication happens between parent & child components?
Please visit our coding session video to get end to end coding demo, it’s a complete one and half hours coding session, see snapshot below: