IcePanel Core Frontend
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
}
}