import {Component, Input,Output, EventEmitter} from '@angular/core'; import {ClaimContext} from '../../claim-utils/claimEntities.class'; @Component({ selector: 'claim-selected-contexts', template: `
Selected Communities ({{contexts.length}})
There are no selected communities
` }) export class ClaimSelectedContextsComponent { ngOnInit() { var myDate = new Date(); this.todayDate=( myDate.getFullYear()+ "-" +myDate.getMonth() + 1) + "-" + myDate.getDate() ; this.nextDate= ( (myDate.getFullYear()+100)+ "-" +myDate.getMonth() + 1) + "-" + myDate.getDate() ; //2015-05-01 // if(this.linkType == "context"){ this.showsearch = true // }else{ // this.showsearch = false; // } } @Input() contexts:ClaimContext[]; //The following need to be kept in case we have to save the current state @Input() public projects; @Input() public results; @Input() public inlineEntity; @Input() componentClass:string = ""; //"" or "col-sm-6" for horizontal display (besides projects) @Input() show='home'; @Input() title='Communities'; @Input() linkType:string = "project"; @Input() hideType; @Input() bulkMode:boolean = false; @Output() showChange = new EventEmitter(); showsearch:boolean = false; todayDate = ''; nextDate = ''; showType(type){ if(type != this.show){ this.show = type; this.showChange.emit({ value: this.show }); } } removeContext(item:any){ var index:number =this.contexts.indexOf(item); if (index > -1) { this.contexts.splice(index, 1); } } contextSelected($event) { // this.showsearch = false; } }