Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Puppet Master's Guide to Injection Tokens

Markus Ingvarsson
May 23, 2023
26

The Puppet Master's Guide to Injection Tokens

Slides from the talk "The Puppet Master's Guide to Injection Tokens" by Markus Ingvarsson

Markus Ingvarsson

May 23, 2023
Tweet

Transcript

  1. Let’s demystify Injection Tokens! After this talk, you will know

    o The essentials of Angular’s Dependency Injection and Injection Tokens o The role of Injection Tokens in enhancing app flexibility and configurability o Hands-on usage of Injection Tokens in real-world scenarios.
  2. 10

  3. Node Injector yn Node Injector yn-1 Node Injector y1 The

    Injectors’ role - creating and retrieving dependencies in the app. Node Injector Hierarchy Environment Injector Hierarchy Root Injector Platform Injector Null Injector
  4. GreatGrandChild Node Injector Node Injector yn-1 Node Injector y1 The

    Injectors’ role - creating and retrieving dependencies in the app. Node Injector Hierarchy Environment Injector Hierarchy Root Injector Platform Injector Null Injector GreatGrand ChildCmp
  5. GreatGrandChild Node Injector GrandChild Node Injector Node Injector y1 The

    Injectors’ role - creating and retrieving dependencies in the app. Node Injector Hierarchy Environment Injector Hierarchy Root Injector Platform Injector Null Injector GreatGrand ChildCmp
  6. GreatGrandChild Node Injector GrandChild Node Injector The Injectors’ role -

    creating and retrieving dependencies in the app. Node Injector Hierarchy Environment Injector Hierarchy Root Injector Platform Injector Null Injector GreatGrand ChildCmp App Node Injector
  7. GreatGrandChild Node Injector GrandChild Node Injector The Injectors’ role -

    creating and retrieving dependencies in the app. Node Injector Hierarchy Environment Injector Hierarchy Root Injector Platform Injector Null Injector GreatGrand ChildCmp App Node Injector
  8. GreatGrandChild Node Injector GrandChild Node Injector The Injectors’ role -

    creating and retrieving dependencies in the app. Node Injector Hierarchy Environment Injector Hierarchy Root Injector Platform Injector Null Injector GreatGrand ChildCmp App Node Injector
  9. Node Injector yn Node Injector yn-1 Node Injector y1 The

    Injectors’ role - creating and retrieving dependencies in the app. Node Injector Hierarchy Environment Injector Hierarchy Root Injector Platform Injector Null Injector
  10. Checkout Component Injector Node Injector yn-1 Node Injector y1 The

    Injectors’ role - creating and retrieving dependencies in the app. Node Injector Hierarchy Environment Injector Hierarchy Root Injector Platform Injector Null Injector showError: false showError: false STEPPER_GLOBAL_OPTIONS STEPPER_GLOBAL_OPTION
  11. Summary o Clarified some core concepts of Angular’s Dependency Injection

    o Uncovered how Injection Tokens can dynamically alter an app’s behaviour o Examples of using Injection Tokens for HTTP requests, pipes and components
  12. Further Reading Angular Documentation o https://angular.io/guide/dependency-injection-overview o https://angular.io/api/core/InjectionToken Decoded Frontend

    – Dependency Injection in Angular @ Youtube o https://www.youtube.com/watch?v=G8zXugcYd7o&list=PLX7eV3JL9sfmJ6Aa Zj9eDlAKrJrEul4Vz Thomas Laforge – Deep dive into the DI system @ Angular Tiny Conf o https://www.youtube.com/watch?v=ZQ9EuzqYLnU Kamil Galek – 5 cool usages of inject function in Angular @ NG-BE 2023 o https://www.youtube.com/watch?v=bH3ASMHgIFE&t=0s
  13. The Puppet Master's Guide to Injection Tokens Markus Ingvarsson @markusingvarssn

    https://github.com/markusingvarsson /acm-puppet-master-injectiontokens Thank you!