Skip to content

OpenCIAg/component-factory

Repository files navigation

@ciag/component-factory

A angular Lib
npm version

Objective: a simplyfied way to generate dynamic angular components, that can also be used as plain DOM.

Table of contents

  1. Installation
  2. Usage

Installation

Intall the @ciag/component-factory via NPM

NPM

    npm i @ciag/component-factory

Usage

app.module.ts

import { ComponentFactoryModule } from '@ciag/component-factory';



@NgModule({
  //...
  imports: [
    //...
    ComponentFactoryModule
  ],
  //...
})
export class AppModule { }

my.component.ts

import { Component, OnInit } from '@angular/core';
import { ComponentFactoryService } from '@ciag/component-factory';

@Component({
    //...
})
export class AppComponent implements OnInit {
    //...
    
    constructor(private componentFactoryService: ComponentFactoryService) { }

    ngOnInit() { 
        this.componentFactoryService.create(MyComponent)
    }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published