1

I was under the impression that slot superseded replaceable, but I've been told replaceable was reintroduced in the 1.0 release, is that true?

Jeremy Danyow
  • 26,470
  • 12
  • 87
  • 133
Meirion Hughes
  • 24,994
  • 12
  • 71
  • 122

1 Answers1

3

replaceable still exists due to a use-case that isn't covered by slots in the Shadow DOM v1 spec:

The new Shadow DOM v1 spec has support for slot "fallback content". As a result, our replaceable attribute is no longer needed and has been removed in favor of slot fallbacks. However, slots do not solve the problem of replacing a template that is used by a repeat, if or other template controller. So, we still support placing the part attribute on a template controller's element and overriding it by using replace-part in the element's content.

http://blog.durandal.io/2016/06/08/getting-prepared-for-aurelia-1-0-0-rc/

Jeremy Danyow
  • 26,470
  • 12
  • 87
  • 133
  • okay so to be abundantly clear; you don't need `replaceable` at all, but you can still use `part` and `replace-part`, correct? – Meirion Hughes Aug 09 '16 at 08:30
  • no- you still need replaceable in repeats: *"However, slots do not solve the problem of replacing a template that is used by a `repeat`, `if` or other template controller..."* – Jeremy Danyow Aug 09 '16 at 10:01
  • Okay, thank you, what you had quoted was a little vague: "replaceable attribute is no longer needed... ...we still support placing the part attribute". – Meirion Hughes Aug 09 '16 at 11:21