Feature: Edit a project

Let's add an edit project form for our feature Edit a project. It consists of a text box for the project name a save and cancel button. Clicking on save will PUT the project to our Express server; clicking on cancel closes the form. We will use the same handlebars template we used for adding a project. In order to make RepositoryListView editable, we will need to introduce the concept of an edit state. We have called editMode.

Let's make some changes to projectView. We start by adding a new event edit to the events hash, which calls an edit function. We change our repository method by passing a new arg.editMode to event_aggregator, which will inform our RepositoryListView that it is in edit mode.

The edit method, which displays ...

Get Advanced Express Web Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.