all InfoSec news
Pass inputs to ngComponentOutlet in Angular
DEV Community dev.to
Introduction
In this blog post, I am going to describe how to use the new syntax to pass inputs to ngComponentOutlet
to create dynamic components in Angular. Prior to Angular 1.16.2, Angular allows injector input in ngComponentOutlet
to provide values. Developers define injection token and useValue to provide Object/primitive value in providers array. With the new way to pass input to ngComponentOutlet
, developers can eliminate boilerplate codes to achieve the same results.
The Pokemon Tab component with Injector
// …
angular array blog blog post components developers dynamic frontend injection injector input inputs introduction object pass token tutorial value