Have ideas to improve npm?Join in the discussion! »

    @icepanel/core-frontend
    TypeScript icon, indicating that this package has built-in type declarations

    0.2.0 • Public • Published

    IcePanel Core Frontend

    npm version npm size npm downloads github issues github prs

    This package provides the Angular module required for creating frontend components for IcePanel plugins.

    Installation

    First install the package into your project.

    npm install @icepanel/core @icepanel/core-frontend
    yarn add @icepanel/core @icepanel/core-frontend

    Usage

    You can then import the Angular module and define the components which should be used.

    import { IModel, PluginType } from '@icepanel/core'
    import { IcePanelFrontendModule, IFrontendModule } from '@icepanel/core-frontend'
    import { PrototypeComponent } from './prototype'
    import { EnvironmentComponent } from './environment'
     
    @NgModule({
      imports: [IcePanelFrontendModule],
      declarations: [PrototypeComponent, EnvironmentComponent],
      entryComponents: [PrototypeComponent, EnvironmentComponent]
    })
    export class FrontendModule implements IFrontendModule {
      environmentComponent(model: IModel) {
        switch (model.plugin.type) {
          case PluginType.App:
            return EnvironmentComponent
          default:
            return null
        }
      }
      prototypeComponent(model: IModel) {
        switch (model.plugin.type) {
          case PluginType.App:
            return PrototypeComponent
          default:
            return null
        }
      }
      setupComponent() {
        return null
      }
    }
     

    Keywords

    none

    Install

    npm i @icepanel/core-frontend

    DownloadsWeekly Downloads

    4

    Version

    0.2.0

    License

    MIT

    Unpacked Size

    27.2 kB

    Total Files

    12

    Last publish

    Collaborators

    • avatar