I know that i could use @ContentChildren to achieve something similar, but 
i would prefer just sugar for `<ng-template 
#child><div>Test</div><ng-template>`.

On Friday, January 17, 2020 at 11:36:39 AM UTC+1, frabbit wrote:
>
> Hello community, 
>
> I currently looking for a way to cut the noise when passing templates to 
> components 
>
> Consider the following code:
>
> ```
> <parent>
>   <ng-template #child1><div>Test</div></ng-template>
>   <ng-template #child2><div>Test</div></ng-template>
> </parent>
> ```
>
> is it possible to create a structural directive that can be used like this 
> or similar?
>
> ```
> <parent>
>   <div *asTemplate="#child1">Test</div>
>   <div *asTemplate="#child2">Test</div>
> </parent>
> ```
>
> so that 
>
> ```
>   <div *asTemplate="#child1">Test</div>
> ```
>
> desugars to 
>
> ```
> <ng-template #child1><div>Test</div></ng-template>
> ```
>
>
> Directly using
>
> <div *asTemplate #child1>Test</div>
>
> doesn't work of course. because the ref is part of the div.
>
>
> Thx a lot!
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/75045b14-899c-44c4-9f1c-b7c7ddeb6d54%40googlegroups.com.

Reply via email to