2

Simple question: Is this somehow possible?

<material-checkbox [(ngModel)]="agbsAccepted" label='I have read <a href="/#/terms" target="_blank">the terms and conditions</a> and accept those.'></material-checkbox>

If I write it like this the HTML is parsed into a normal string. But if I write it do not use the label property its sometimes difficult to style.

1 Answer 1

2

HTML in string interpolation bindings is not supported. The label attribute is added using string interpolation

<div class="content">
  {{label}}
  <ng-content></ng-content>
</div>

material-checkbox template source

As you see in the template, projected context is supported though, therefore this should do what you want:

<material-checkbox [(ngModel)]="agbsAccepted">
  I have read <a href="/#/terms" target="_blank">the terms and conditions</a> and accept those.
</material-checkbox>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.