From the course: Angular: Animations

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Creating route view components

Creating route view components - Angular Tutorial

From the course: Angular: Animations

Start my 1-month free trial

Creating route view components

- [Instructor] We'll now go about building a set of components which will be controlled by the router once it is set into place. This will allow the user to switch different views through the main navigation of our project. Each view will eventually contain different Angular animation demos. So, right now we have our app.component.ts file. Let's go ahead and inside of our source folder, we'll create a new file and call this home.component.ts, all right. You'll find in our snippet file that we have a snippet for a basic component so we'll paste that in here and this basic component snippet just imports component from Angular Core and then we declare our component metadata such as our template and our styles. And again, these are backticks and not simple single quotes. This allows us to do multi-line templates and styles inside of Angular. And then we export class MyComponent. However, this is going to be called HomeComponent eventually, but we'll get to that in a minute. What we're…

Contents