Get I.T. Going

Acquire services dynamically (or generically) in Angular 2+

Acquiring a service dynamically through injector in Angular 2(+) is pretty straightforward. All you have to do is inject the Injector itself into the component's constructor instead of the services and then get the service instance by using the injector.get() method.
Read more »
No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: Angular 2, Angular 4, Dynamically inject services in Angular 2
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Blog Archive

  • ▼  2018 (7)
    • ►  June (1)
    • ►  May (3)
    • ▼  March (1)
      • Acquire services dynamically (or generically) in A...
    • ►  February (2)
  • ►  2017 (9)
    • ►  September (2)
    • ►  June (2)
    • ►  March (1)
    • ►  February (1)
    • ►  January (3)
  • ►  2016 (14)
    • ►  December (3)
    • ►  November (3)
    • ►  October (1)
    • ►  June (2)
    • ►  May (4)
    • ►  April (1)
Awesome Inc. theme. Theme images by Leontura. Powered by Blogger.