Based on the following component, what template syntax would you use to bind the TitleCardComponent’s titleText field to the h1 element title property?

@Component({
    selector: ‘app-title-card’,
    template: ‘<h1 title=”User Data”> {{titleText}}</h1>’
})
export class TitleCardComponent {
    titleText = ‘User Data’;
}
  •  <h1 data-title=”titleText”>{{ titleText }}</h1>
  •  <h1 title=”titleText”>{{ titleText }}</h1>
  •  <h1 [title]=”titleText”>{{ titleText }}</h1>
  •  <h1 titleText>{{ titleText }}</h1>

Leave a Reply

Your email address will not be published. Required fields are marked *