Conclusion on Event Update
Let's conclude what we’ve learned so far and upload our updated application to GitHub.
We'll cover the following
What have we done so far?
In this chapter:
- We added the last remaining service method to
EventsService
for updating an event. - We created our new
EventUpdateComponent
, adding a link to our new view withinEventViewComponent
. - We populated a template-driven form with the values for the requested event, providing event creators the ability to update existing events.
There’s just one small issue that still needs to be addressed. In EventViewComponent
, we utilized the isEventCreator
service method within EventsService
to display the “Edit” link only to the creator of an event. But, a user who knows of the /update
URL can simply append /update
to the URL when they’re viewing an event, giving them access to this view along with the ability to update an event they didn’t create.
Before moving forward, let’s commit our latest changes and push them to GitHub.
Note: Git may ask you to set your account’s identity before committing changes to the GitHub. For this, use the following commands to set your email address and username.
git config --global user.email "you@example.com" git config --global user.name "Your Name"
Below are the commands to push changes to the GitHub repository.
git init
git remote add origin https://github.com/your-username-here/lets-get-lunch-fe.git
git add .
git commit -m "Add event update"
git push origin master
Run the code below and execute the commands in the lets-get-lunch
directory.
Get hands-on with 1200+ tech skills courses.