This lesson is for PRO members.

Unlock this lesson NOW!
Already subscribed? sign in

AngularJS Architecture: Create Bookmark

6:29 Angular 1.x lesson by

In this lesson, we will complete the functionality to create a bookmark. We start by adding a createBookmark method on the BookmarksModel and then making it available to the CreateBookmarksCtrl. From there, we flesh out the CreateBookmarksCtrl and refactor the template to use the new "Controller as" syntax.

Get the Code Now
click to level up

egghead.io comment guidelines

Avatar
egghead.io

In this lesson, we will complete the functionality to create a bookmark. We start by adding a createBookmark method on the BookmarksModel and then making it available to the CreateBookmarksCtrl. From there, we flesh out the CreateBookmarksCtrl and refactor the template to use the new "Controller as" syntax.

Avatar
Raul

In the function returnToBookmarks() how does $stateParams knows about .category, since category is no longer in the link on top of the page?

In reply to egghead.io
Avatar
Lukas

With ui-router, $stateParams is not dependent on URL parameters. The state of the application drives the parameters and in most cases but not all, the URL parameters will reflect that.

In reply to Raul
Avatar
Raul

My bad, actually the link is: #/categories/Development/bookmarks/create
so the :category is there. And yes, it seems that the url parameter is added to the existing state url. Thanks.

In reply to Lukas
HEY, QUICK QUESTION!
Joel's Head
Why are we asking?