You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 5
Next »
Before Start
Adding the Angular Library Step-by-step guide
- Install angular-cli
- Cd to saga-server/src/main/resources/webapp/projects/saga-plugin/src/lib
- Cd to either the processors or the recognizers folder, denpending of the type of component you want to build
- Recognizers for tags
- Processors for pipelines
- Create a component
ng generate component --style=scss --skipTests=true --skipImport=true
- Cd to <component-name> folder
- Create a component
- The name must contain config-dialog at the end of the name
ng generate component --style=scss --skipTests=true --skipImport=true
- Next open the file <component-name>-config-dialog.component.ts
- Extend the component with ConfigDialogBase (the implementation is further explained in the document)
export class ComponentNameConfigDialogComponent extends ConfigDialogBase implements OnInit {
- Next go up one level and open the file <component-name>.component.ts
- Extend the component with the right abstract class:
- PluginComponent - used for plugins not containing a dictionary of patterns, for example the "Number" recognizer.
- PatternComponent - used for plugins that need to store a dictionary of patterns, for example "Entity", "Regex" or "Advanced" recognizers.
- Open to projects/saga-plugin/src/lib/plugin.module.ts
- Import the components
import {<component-name>Component} from './<processors or recognizers>/<component-name>/<component-name>.component';
import {<component-name>ConfigDialogComponent} from './<processors or recognizers>/<component-name>/<component-name>-config-dialog/<component-name>-config-dialog.component';
- Add the main component into the array called components
const components = [
RegexComponent,
.
.
.
<component-name>Component
];
- Add the config dialog component into the array called entryComponents
const entryComponents = [
PatternActionsDialogComponent,
EntityActionsDialogComponent,
.
.
.
<component-name>ConfigDialogComponent
];
Related articles
There is no content with the specified labels