WorkFlow Diagram Editor
[sdc/sdc-workflow-designer.git] / sdc-workflow-designer-ui / src / app / app.component.ts
1 /**
2  * Copyright (c) 2017 ZTE Corporation.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * and the Apache License 2.0 which both accompany this distribution,
6  * and are available at http://www.eclipse.org/legal/epl-v10.html
7  * and http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Contributors:
10  *     ZTE - initial API and implementation and/or initial documentation
11  */
12
13 import { Component, AfterViewInit } from '@angular/core';
14 import { JsPlumbService } from "./services/jsplumb.service";
15
16 @Component({
17   selector: 'app-root',
18   templateUrl: './app.component.html',
19   styleUrls: ['./app.component.css']
20 })
21 export class AppComponent implements AfterViewInit {
22     constructor(private jsplumbService: JsPlumbService) {}
23
24     public nodes = [
25         {
26             id: '001',
27             name: 'node001',
28             top: 50,
29             left: 50,
30         },
31         {
32             id: '002',
33             name: 'node002',
34             top: 250,
35             left: 50,
36         },
37         {
38             id: '003',
39             name: 'node003',
40             top: 140,
41             left: 450,
42         },
43     ];
44
45     ngAfterViewInit(): void {
46         this.jsplumbService.initJsPlumbInstance();
47         this.jsplumbService.initNode('.node');
48     }
49 }