From the course: Learning Angular

Unlock the full course today

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

Binding data to templates

Binding data to templates - Angular Tutorial

From the course: Learning Angular

Start my 1-month free trial

Binding data to templates

- [Instructor] Angular lets you use the data that you have in your components inside your templates, and that is known as binding, so we'll take a look at it in this video. Now, your components interact with templates in a variety of ways, and the most common is through the use of expressions. This involves making objects declared in your components available inside your templates using double curly braces. The content in the curly braces can be simple in the case of when we just output a variable, or more complex. Another way of interacting with your templates is through the use of directives. Directives are a fancy name for commands, which are usually used in your HTML template, and they look like HTML attributes with a few extra characters. Inside your components, you can set up variables and initialize their values. One of the ways of doing this is through something called a constructor. A constructor is a way of giving values to your variables, sometimes called instantiating your…

Contents