import {Component, Input, Output, EventEmitter} from '@angular/core'; @Component({ selector: 'search-sorting', template: ` Sort by: ` }) export class SearchSortingComponent { @Input() sortBy: string = ''; @Input() entityType: string = ''; @Output() sortByChange = new EventEmitter(); constructor () {} ngOnInit() {} sortByChanged() { this.sortByChange.emit({ value: this.sortBy }); } }