import { SearchQueryBuilderService } from '@alfresco/adf-content-services' ; import { SearchSortingDefinition } from '@alfresco/adf-content-services/lib/search/models/search-sorting-definition.interface' ; import { Component , OnInit , Output , ViewEncapsulation , EventEmitter } from '@angular/core' ; @ Component ( { selector : 'aca-search-action-menu' , templateUrl : './search-action-menu.component.html' , encapsulation : ViewEncapsulation . None } ) export class SearchActionMenuComponent implements OnInit { @ Output ( ) sortingSelected : EventEmitter < SearchSortingDefinition > = new EventEmitter ( ) ; options : SearchSortingDefinition [ ] = [ ] ; constructor ( private queryBuilder ) { } ngOnInit ( ) { this . options = this . queryBuilder . getSortingOptions ( ) ; } onAscSortingClicked ( option ) { option . ascending = true ; this . sortingSelected . emit ( option ) ; } onDescSortingClicked ( option ) { option . ascending = false ; this . sortingSelected . emit ( option ) ; } }