5a86150e8cb44b6401e5aed47a0a4fcaca40963c
[ccsdk/cds.git] /
1 import {Component, OnInit} from '@angular/core';
2 import {DesignerStore} from '../designer.store';
3 import {ModelType} from '../../model/ModelType.model';
4
5
6 @Component({
7     selector: 'app-functions',
8     templateUrl: './functions.component.html',
9     styleUrls: ['./functions.component.css']
10 })
11 export class FunctionsComponent implements OnInit {
12     viewedFunctions: ModelType[] = [];
13
14     constructor(private designerStore: DesignerStore) {
15
16         this.designerStore.state$.subscribe(state => {
17             console.log(state);
18             if (state.functions) {
19                 this.viewedFunctions = state.functions;
20             }
21         });
22     }
23
24     ngOnInit() {
25         this.designerStore.getFuntions();
26     }
27
28 }