angular icon indicating copy to clipboard operation
angular copied to clipboard

Rename `<template>` to `<ng-template>`

Open zoechi opened this issue 7 years ago • 2 comments

Angular fully claiming the <template> tag prevents for example

    <dom-repeat items="{{employees}}">
      <template>
        <div>First name: <span>{{item.first}}</span></div>
        <div>Last name: <span>{{item.last}}</span></div>
      </template>
    </dom-repeat>

https://www.polymer-project.org/2.0/docs/api/elements/Polymer.DomRepeat

inside an Angular component

That was also done in TS

  • https://angular.io/guide/structural-directives#the-asterisk--prefix
  • https://github.com/angular/angular/blob/master/CHANGELOG.md#400-rc1-2017-02-24 (section Features)

zoechi avatar Mar 08 '18 19:03 zoechi

We talked a bit offline, but if we do this, it won't be until 5.1+.

A likely story would be adding support for <ng-template>, but making it optional, and potentially also adding a way to say "this is a native template tag", i.e. <template @native> (or better syntax).

... we could fix it in 6.0, but that might be for aw while.

matanlurey avatar Mar 08 '18 19:03 matanlurey

<twitter-login>
  <template>I am a thing</template>
</twitter-login>

We could solve this with @supressXXX or rename to <ng-template>.

matanlurey avatar Oct 09 '18 21:10 matanlurey