To finish your application, take a look at how you can pass variables through your routes.
- [Instructor] To finish this application,…we're going to wire the list right here to our details page,…and then also fix it, so that we can use navigation…within the details page.…So right now we can only see one of these users,…and we're going to fix that.…So, let's go ahead and hit the back button here.…Angular has a mechanism for passing information along…to the controllers within the URL.…It's a library called Route Parameters,…and all we need to do is add a colon right here…and pass along a variable name,…which we can then use in the controllers.…
So I'll use the variable itemId here in my route.…Let's go ahead and save it,…and then within my controllers,…I'm going to use this other library called routeParams.…So in addition to using scope as well as http…in my DetailsController,…I'm going to add $routeParams,…and instead of passing along a specific number,…I'll use $routeParams.…
So, think of $routeParams as a variable…that is going to hold all the information…that comes from the route.…So because in the app.js we're passing…
In this short, practical course, Ray Villalobos uses AngularJS to build a searchable directory—a project you can use as the basis for your own employee or user directory. He explains the MVC architecture underlying AngularJS, and the differences you can expect to encounter in Angular 2. Then he shows how to control the display of DOM elements and data; use services like $http and $routeProvider; modify content with filters; add two-way data binding; and work with routes and templates. Start watching, and learn the simple way to build your own complex web application with AngularJS.
- What is AngularJS?
- Binding data
- Defining modules and controllers
- Using the $http service to read a JSON file
- Controlling app logic with conditionals and loops
- Filtering content and lists
- Deep linking