-
Notifications
You must be signed in to change notification settings - Fork 26.3k
feat(NgTemplateOutlet): add NgTemplateOutlet directive #8021
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(NgTemplateOutlet): add NgTemplateOutlet directive #8021
Conversation
@mhevery opening a PR to kick off detailed discussion on the NgInsert / NgOutlet directive discussed in #7615. Opening a PR with the simplest possible and useful implementation. We can gradually add more features like:
cc @jelbourn |
9a478ff
to
74f2eb9
Compare
@pkozlowski-opensource Thanks for kicking this off! I think it's important to consider component loading in the initial API; in particular, we may want a single property that can be set to load either a |
* Creates and inserts an embedded view based on a prepared `TemplateRef`. | ||
* | ||
* ### Syntax | ||
* - `<ng-insert [templateRef]="templateRefExpression"></ng-insert>` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a better syntax would be:
<template [ngInsert]="templateRefExpression"></template>
The reason is that we would prefer not have floating <ng-insert>
in the final DOM.
I am also wondering if there may be a better name then insert
??
<template [ngOutlet]="templateRefExpression"></template>
Looks, good. Sorry, my only comment is about name (bit o bikeshedding.) |
@mhevery thnx for the review. I like the suggestion of having @jelbourn yep, let's build on top of this for components, locals etc. I will be in MTV in 4 weeks so we can iterate on this one. |
@pkozlowski-opensource what is your thought on I am with you on using |
we could do comments |
I've "tested" |
I think I also like |
6698ef4
to
6e6e25d
Compare
OK, did all the renamings / refactors discussed in the PR. Rebased, build is green. |
The PR looks great, but we got into a naming discussion. The issue is that Sorry, I know this is bikeshedding, but naming is important. The team thinks we should call it |
Personally I don't feel too strong about names so I'm perfectly fine with Thnx for looking into this / discussing! |
acdb3ea
to
e66b087
Compare
e66b087
to
1954db7
Compare
This commits adds a new NgTemplateOutlet directive that can be used to create embeded views from a supplied TemplateRef. Closes angular#7615
@mhevery did the discussed renaming. Dart build is failing but I don't think it is related to my change. |
Yes, dart change is unrelated. |
Merging PR #8021 on behalf of @robertmesserle to branch presubmit-robertmesserle-pr-8021. |
Hello, Im trying to use this feature but with no success. I will really appreciate any help with this |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
New feature
There is no standard way of creating embeded views from a template.
A new
NgInsert
directive makes it possible to create an embeded view from a providedTemplateRef
No
Closes #7615