Created
February 11, 2018 11:13
-
-
Save gparlakov/080ece78188893c8d4287fc8810c6a56 to your computer and use it in GitHub Desktop.
2. Workaround
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Injectable() | |
export class TimeService { | |
// ... some useful stuff | |
onDestroy(): void { | |
// ... some clean up logic | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({/*... omitted for brevity*/}) | |
export class TimeWidgetComponent implements OnDestroy{ | |
constructor(private timeService: TimeService) { | |
// useful stuff using timeService | |
} | |
ngOnDestroy() { | |
this.timeService.onDestroy(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment