@naetverkjs/angular-renderer
v0.8.54
Published
```ts import { AngularRenderPlugin } from '@naetverkjs/angular-renderer';
Downloads
4
Maintainers
Readme
angular-renderer
Install
import { AngularRenderPlugin } from '@naetverkjs/angular-renderer';
editor.use(AngularRenderPlugin);
Import NaetverkModule
import { NaetverkModule } from '@naetverkjs/angular-renderer';
@NgModule({
imports: [NaetverkModule],
})
export class AppModule {}
Examples
Control
import { AngularControl } from '@naetverkjs/angular-renderer';
export class NumControl extends Control implements AngularControl {
component: Type<ControlComponent>
props: {[key: string]: unknown}
constructor(key) {
super(key);
this.component = ControlComponent;
this.props = // key-value
// ...
}
}
Custom node
Extend node component
import { NodeComponent, NodeService } from '@naetverkjs/angular-renderer';
@Component({
templateUrl: './node.component.html', // copy template from src/node
styleUrls: ['./node.component.sass'], // copy styles from src/node
providers: [NodeService],
})
export class MyNodeComponent extends NodeComponent {
constructor(protected service: NodeService) {
super(service);
}
}
Add component to entryComponents
of your module
@NgModule({
entryComponents: [MyNodeComponent],
})
export class AppModule {}
Custom component for all nodes
editor.use(AngularRenderPlugin, { component: MyNodeComponent });
Custom component for specific node
import { Component } from '@naetverkjs/naetverk';
import { AngularComponent, AngularComponentData } from '@naetverkjs/angular-renderer';
export class AddComponent extends Component implements AngularComponent {
data: AngularComponentData;
constructor() {
super('Add');
this.data.render = 'angular';
this.data.component = MyNodeComponent;
}
// ...
}