From the course: Learning Angular

Unlock the full course today

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

Understanding templates in Angular

Understanding templates in Angular - Angular Tutorial

From the course: Learning Angular

Start my 1-month free trial

Understanding templates in Angular

- [Instructor] Although the CLI automatically creates some things for you, it's important that you understand how you can change things. So let's take a deeper look at how Angular works with templates. By default, the template creates a template URL tag as the configuration object in your decorator, which we'll look at in just a minute. But you can also simply include a template option and type in a template using text within the component itself. That means that you can use the ES6 template syntax which includes backticks to create more complex HTMLs. So let's take a look at how that works. Here we have our simple component. And you'll notice that we're accessing this template from a URL, and right now it's pointing to app component.html, which is this file right here. And if you want to, though, you can modify that so that your template exists right here. So let's go ahead and delete this URL part and just call something called template. Now that means that in here I can type in…

Contents