๐ Save the form data with the navigation alert
Challenge #48
Context
As a member of the development team, you need to address a specific request from the product owner, Bob ๐งโโ๏ธ He wants to develop a new feature in response to customer complaints about losing form input information.
User Story
Hereโs the feature expressed as a user story (functional expectation)
โAs a user, I would like to have an alert dialog box that appears when I attempt to navigate away from the /form page after I have started entering information into the form.โ
Acceptance Criteria
- On the /form page:
- If the input text has been pre-filled, then an alert dialog box opens.
- Otherwise, the user navigates normally.
- The content of dialog.component.ts must be use for your dialog box content
- The appearance and behavior of the alert dialog box must comply with W3C conventions, see alert dialog pattern
- Maximize the use of the new concepts and syntax in the latest version of Angular.
Tips ๐คซ (if you really need it and after careful consideration)
- Use the Material CDK Dialog or Overlay - https://material.angular.io/cdk/ (dont forget to add @import '@angular/cdk/overlay-prebuilt.css' in style.sccss)- Use the CanDeactivate guard - https://angular.io/api/router/CanDeactivate (use new functionnal approach).