7.0: Member Edit Component
Now, we're going to add a MemberEditComponent where a logged in user can make changes to their profile page. This will be similar to the MemberDetailComponent, but with added functionality.
Generate the MemberEditComponent
In the root of your SPA
project, run the following command:
Ensure that it is imported into the app.module.ts
Add a Link in Navbar Dropdown
Next, we need to update the link in our navbar dropdown.
Open up nav.component.html, and in the dropdown section, update it to use a routerLink:
Add a Resolver
To bring in the user's data, we'll add another resolver.
In the resolvers folder, add a new file called member-edit.resolver.ts. This file will be very similar to the member-detail.resolver.ts file - so, feel free to reuse the code and edit it accordingly.
Next, we need to import the resolver and add it to the providers array in our app.module.ts
Add to routes
We need to add the new component to our routes.ts file:
Update Component Controller
In member-edit.component.ts, update the class to the following:
Last updated