import {Component, Input,Output, EventEmitter} from '@angular/core';
import {ClaimContext} from '../../claim-utils/claimHelper.class';
@Component({
selector: 'claim-selected-contexts',
template: `
0 " class=" ">
-
{{context.community }} > {{context.category}} > {{context.concept.label}}
`
})
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();
@Input() localStoragePrefix:string = "";
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);
if(this.contexts != null){
localStorage.setItem(this.localStoragePrefix + "contexts", JSON.stringify(this.contexts));
}
}
}
contextSelected($event) {
// this.showsearch = false;
}
}