Join Justin Schwartzenberger for an in-depth discussion in this video Route configuration, part of Angular 2 Essential Training (2016).
- [Voiceover] With the route bundle script included…and a base href added to the index HTML file…and router_providers in our bootstrap,…we are ready to start routing.…First thing we need to do is configure routes.…This is done with the RouteConfig decorator.…The app component is the entry point to the app…so let's add the routes there.…We need to import the RouteConfig decorator…from Angular2/router then we can decorate…the app component class…by adding @RouteConfig in front of it.…
We can put this before or after the component decorator,…it doesn't matter where.…TypeScript will handle transpiling them for us.…RouteConfig takes an array of route definitions.…These can be defined with objects…so let's pass an array using a pair of square brackets…then create an object literal.…A route requires a path and a component at a minimum…so let's start with a path property.…It's expecting a string so let's give it /add…and then for the component property…that's expecting a type, so we can set that to…MediaItemFormComponent.…
- What is Angular?
- Setting up an Angular template
- Creating a component
- Displaying data
- Working with events
- Using two-way data binding
- Creating a subcomponent
- Using the built-in HTTP module
- Using the built-in router module
Skill Level Intermediate
AngularJS and WordPress: Building a Single-Page Applicationwith Roy Sivan31m 52s Intermediate
Building a Mobile App with AngularJS 1 and Ionicwith Ray Villalobos3h 31m Intermediate
1. Architecture Overview
3. Directives and Pipes
5. Dependency Injection and Services
Next steps1m 20s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.