Project

General

Profile

1
import {Component, Input, Output, EventEmitter} from '@angular/core';
2

    
3
import {ClaimResult} from '../claim-utils/claimEntities.class';
4

    
5
@Component({
6
    selector: 'start-over',
7
    template: `<button   (click)="startOver()"  class="uk-button uk-button-danger uk-align-right"  >Start Over</button>`,
8

    
9
})
10
export class StartOverComponent {
11
  constructor () {
12

    
13

    
14
  }
15
  ngOnInit() {
16

    
17
}
18

    
19

    
20
  // @Input() public inlineEntity = null;
21
  @Input() public type:string;
22
  @Input() public linkTo:string;
23
  @Input() public results;
24
  @Input() public projects;
25
  @Input() public contexts;
26

    
27

    
28
  startOver(){
29
    console.log("projects:"+this.projects.length +" contexts:"+this.contexts.length + " results:"+this.results.length );
30
    if(this.type != null && this.linkTo != null){
31
      console.log("inline");
32
      if(this.linkTo == "project"){
33
        this.projects.splice(0, this.projects.length);
34
      }else if(this.linkTo == "context"){
35
        this.contexts.splice(0, this.contexts.length);
36
      }else if(this.linkTo == "result"){
37
          this.results.splice(0, this.results.length);
38
      }
39
      }else{
40
        console.log("generic");
41
        this.results.splice(0, this.results.length);
42
        this.projects.splice(0, this.projects.length);
43
        this.contexts.splice(0, this.contexts.length);
44
      }
45
    console.log("projects:"+this.projects.length +" contexts:"+this.contexts.length + " results:"+this.results.length );
46
  }
47

    
48
}
(10-10/11)