import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'; @Component({ selector: 'gc-program-automation-builder-share', templateUrl: './program-automation-builder-share.component.html', styleUrls: ['./program-automation-builder-share.component.scss'] }) export class ProgramAutomationBuilderShareComponent implements OnInit, OnChanges { @Input() landingLinkGuid: string; route: string; afterInit = false; ngOnInit () { this.setRoute(); this.afterInit = true; } ngOnChanges (changes: SimpleChanges) { if (changes.landingLinkGuid && this.afterInit) { this.setRoute(); } } setRoute () { if (this.landingLinkGuid) { this.route = `/apply/programs/${this.landingLinkGuid}/routing`; } else { this.route = ''; } } }