- [Instructor] Templates become more powerful when…they can do things that are connected to our component.…Now the simplest way to tie a template to a component…is through interpolation.…You can use double curly braces to bind the property name…from your component to your template.…Let's go ahead and check this out.…So if I wanted to display something on this label,…what I can do is type in something like this…within curly braces and I'm going to add…a variable interpolation here for name.…
Let's go ahead and make this window bigger…so we can see it all at once.…And to pass that along into our template,…all I need to do in my component is to add that variable…in this export class.…Let's go ahead and do that.…We will add a variable called "name".…And let's go ahead and set that to "name".…We'll use "Hassum Harod" here,…and now I'm going to save this.…And if I show you my terminal, you should see…that name automatically appear here.…
So let's go ahead and use another one here.…And you can see that once my automation refreshes the page,…
In this course, Ray Villalobos shows you how to start using Angular 2 in your own projects. He starts by defining what exactly Angular 2 is and how it differs from AngularJS 1. Then, once the basics are out of the way, he sets up the template that will drive the project and starts coding. Ray shows how to divide your project into modules, work with events, style content with CSS, and create components and subcomponents. Plus, you can find out how to change content dynamically using data pipes.
Note: Members can find a template to download in the exercise files.
- What is Angular 2?
- Setting up a template
- Creating a simple component
- Using multiple modules
- Displaying data in templates
- Working with events
- Creating a subcomponent
- Filtering content through data pipes