UNPKG

mp-common

Version:

This is XPO MarketPlace common libary

32 lines (26 loc) 895 B
import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core'; import { LaneFilter } from '../../core'; @Component({ selector: 'app-lane-search', templateUrl: './lane-search.component.html', styleUrls: [ './lane-search.component.scss' ] }) export class LaneSearchComponent implements OnInit { @Input() filter: LaneFilter; @Output() filterChange = new EventEmitter(); constructor() { } ngOnInit() { } onChangeLaneFilter() { this.filterChange.emit(this.filter); } swapOriginDest() { let origin = this.filter.origin; let originDeadEnd = this.filter.laneOriginDeadHead; this.filter.origin = this.filter.destination; this.filter.laneOriginDeadHead = this.filter.laneDestDeadHead; this.filter.destination = origin; this.filter.laneDestDeadHead = originDeadEnd; this.onChangeLaneFilter(); } }