AngularJS Architecture: Edit Bookmark

Share this video with your friends

Send Tweet

In this lesson, we are going to complete the functionality for editing a bookmark. We will start by augmenting the BookmarksModel and then updating the controller and view to utilize the new functionality. We will also update the BookmarksModel.getBookmarks to cache the bookmarks so that we are not overwriting our updates on every call.

Alex Guirguis
Alex Guirguis
~ 9 years ago

When you click on the pencil icon to edit or the "Create Bookmark" link, where do the create/edit html templates get displayed? How does it know to render under the bookmarks??

Alex Guirguis
Alex Guirguis
~ 9 years ago

Also, the 'subscribe' feature on these threads does not work. It redirects me to "Uh oh, something went wrong. Why don't you watch a video instead."

Alex Guirguis
Alex Guirguis
~ 9 years ago

Last question - where does the category param come from in the below line:

$state.go('eggly.categories.bookmarks', { category: $stateParams.category })

Santhosh Kumar
Santhosh Kumar
~ 9 years ago

The entire app started out this way. The placement/rendering part was already done in https://egghead.io/series/angularjs-app-from-scratch-getting-started.

All he did in this series was make it modularized and move around the code, whereas the placement/structure hasn't changed.

Chris
Chris
~ 9 years ago

Quick question,

  1. I'm unable to edit a bookmark in the root view.
  2. But i am able to edit a bookmark after clicking into one of the categories. Does anyone have advice on how i might troubleshoot this?
Lukas Ruebbelke
Lukas Ruebbelke(instructor)
~ 9 years ago

Hey Chris, I just updated the master branch with a fix to this. I added a "category" parameter to the transition definition of a bookmark's edit state in the bookmarks template. Let me know if you have any more questions.