How can I show a confirmation message when I change the component in Angular 2
.
Example: If I have a form and full information and suddenly press a "Back" button (that sends me to another component) to show a message or alert that says " The information entered will be lost this insurance? YES or NO ", if I press Do not cancel the event ngOnDestroy ().