/** * @Component Name: SearchComponent * @Module: Home * @Module Functionality : To display the search details * @Creation Date: August 12,2017 * @Author: sbaireddy * @Version: 1.0 */ import { Component, OnInit, OnDestroy } from '@angular/core'; import { SharedService } from '../../shared/shared.service'; @Component({ moduleId: module.id, selector: 'search-cmp', templateUrl: 'search.component.html' }) export class SearchComponent implements OnInit, OnDestroy { private COMPONENT_NAME: string = 'SearchComponent'; constructor(public sharedService: SharedService) { } /** * This function is used to initialize the directive/component after Angular * first displays the data-bound properties.It is invoked only once when the * directive is instantiated. * @returns void */ ngOnInit(): void { const METHOD_NAME: string = 'ngOnInit()'; this.sharedService.showClearAll(false); this.sharedService.updateErrorMessage(null); } /** * Cleanup just before Angular destroys the directive/component. * Unsubscribe Observables and detach event handlers to avoid memory leaks. * @return {void} */ ngOnDestroy(): void { const METHOD_NAME: string = 'ngOnDestroy()'; } }