Angular: Add `ngOutletContext` attribute to `NgTemplateOutlet` similar to TS

Created on 17 Aug 2016  路  13Comments  路  Source: angulardart/angular

Please add ngOutletContext attribute to NgTemplateOutlet.

In TS version you can see how this attribute is being implemented:

https://github.com/angular/angular/blob/2.0.0-rc.5/modules/%40angular/common/src/directives/ng_template_outlet.ts#L38

this attribute allows to change the context of the outlet, which allows to use the component internal scope
instead the scope of the current component

<template [ngTemplateOutlet]="templateRefExpression"
          [ngOutletContext]="objectExpression">
</template>

I already create a similar directive into ng_bootstrap, this directive is BsTemplateOutlet you can find the source code here:

https://github.com/dart-league/ng_bootstrap/blob/develop/lib/components/template_outlet/bs_template_outlet.dart

good first issue

Most helpful comment

Ok, I'll do it at night

All 13 comments

@ferhatb What do you think of this change? Make sense?

Hi Luis makes sense to add. Would you like to contribute and send us PR?

I could translate code from TS version, however the unit test will fail.

That's fine, we can tackle the unit test (working on our new testing story now).

Ok, I'll do it at night

馃憤

I created the pull request #50, please take a look

What should be done to move this forward?

Please ping me if this gets solved, its something we could analyze.

No action in ~4 months.

Closing for now as we don't have any internal requirements and no PR was merged.

How can we create grid or typeahead component without it?

it is really needed

It's not difficult to create your own MyTemplateOutlet directive from NgTemplateOutlet and add a ngOutletContext.
I did it but couldn't find the time to polish it enough for a pull request (add tests, ...)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

double11one picture double11one  路  6Comments

AndreyChernykh picture AndreyChernykh  路  4Comments

mandreyel picture mandreyel  路  6Comments

filiph picture filiph  路  4Comments

ranquild picture ranquild  路  6Comments