rete-angular-render-plugin

esm
Angular Render (experimental) ==== #### Rete.js plugin
Version 0.3.0 License MIT
Keywords
angularrete.js
INSTALL
Type:
Version:
- Static
- Latest Patch
- Latest Minor
- Latest Major
- 0.3.0
- 0.2.2
- 0.2.1
- 0.1.1
- 0.1.0
- 2.0.0-beta.20
- 2.0.0-beta.19
- 2.0.0-beta.18
- 2.0.0-beta.17
- 2.0.0-beta.16
- 2.0.0-beta.15
- 2.0.0-beta.14
- 2.0.0-beta.13
- 2.0.0-beta.12
- 2.0.0-beta.11
- 2.0.0-beta.10
- 2.0.0-beta.9
- 2.0.0-beta.8
- 2.0.0-beta.7
- 2.0.0-beta.6
- 2.0.0-beta.5
- 2.0.0-beta.4
- 2.0.0-beta.3
- 2.0.0-beta.2
- 2.0.0-beta.1
- 0.3.0-rc.1
- 0.2.0-rc.2
- 0.2.0-rc.1
- 0.1.2-rc.1
- 0.1.0-draft
<script type="module"> import reteAngularRenderPlugin from 'https://cdn.jsdelivr.net/npm/rete-angular-render-plugin@0.3.0/+esm' </script>
Angular Render (experimental)
Rete.js plugin
import { AngularRenderPlugin } from 'rete-angular-render-plugin';
editor.use(AngularRenderPlugin);
Import ReteModule
import { ReteModule } from 'rete-angular-render-plugin';
@NgModule({
imports: [ReteModule]
})
export class AppModule {}
Examples
Control
import { AngularControl } from 'rete-angular-render-plugin';
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 { Component, ChangeDetectorRef } from "@angular/core";
import { NodeComponent, NodeService } from 'rete-angular-render-plugin';
@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, protected cdr: ChangeDetectorRef) {
super(service, cdr);
}
}
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 'rete';
import { AngularComponent, AngularComponentData } from 'rete-angular-render-plugin';
export class AddComponent extends Component implements AngularComponent {
data: AngularComponentData;
constructor() {
super('Add');
this.data.render = 'angular';
this.data.component = MyNodeComponent;
}
// ...