eggheadio/egghead-angularjs-from-scratch-getting-started

Current category of a new bookmark is not set

WillTaylor22 opened this issue · 3 comments

Should be:
function createBookmark(bookmark){
bookmark.id = $scope.bookmarks.length;
bookmark.category = currentCategory; // <-----
$scope.bookmarks.push(bookmark);

    resetCreateForm();
  }

Actually the line:
bookmark.category = currentCategory;
should be
bookmark.category = currentCategory.name;

The line should be:

bookmark.category = $scope.currentCategory.name;

The example code should be updated with bookmark.category = $scope.currentCategory.name;. (line 58 here)