1

I'm upgrading an existing project to Angular2 rc1 and the beta1 version of the cli

A previously working piece of code:

<main [attr.style]="isEmbeded ? '' : 'margin-top: 82px;'" >

is no longer working it now renders as:

<main _ngcontent-mak-1="" style="unsafe">

Has something changed that I'm not aware of?

Mark
  • 2,392
  • 4
  • 21
  • 42
  • They yet need to fine-tune what values they allow by default. They added the sanitation functionality and it currently is a bit to eager about what it allows or removes. – Günter Zöchbauer May 10 '16 at 07:56
  • Looks like it is the same problem you linked to. Never came across it during my searched – Mark May 10 '16 at 08:19

1 Answers1

3

Well I've not found an answer to why this is no longer allowed but I have managed to resolve it by using this instead:

<main [style.margin-top.px]="isEmbeded ? '' : '82'" >
Mark
  • 2,392
  • 4
  • 21
  • 42