1

I've seen examples which show the template string in the component annotation:

@Component({
  selector: 'example-app',
  template: `
<h4 class="header"> Heading of {{heading}}
</h4>`
});

And also examples which show the template string in the view annotation:

@View({
template: `
<div class="row" (click)="clicked()">
<div product-image [stuff]="stuff">
  </div>
`,
  directives: [example]
})

What is the difference or is it simply interchangeable and it doesn't matter where you specify the template string?

Hard worker
  • 3,916
  • 5
  • 44
  • 73

0 Answers0