Skip to content
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

[Angular Elements]: Adding ComponentNgElementStrategyFactory & ComponentNgElementStrategy to public API #26112

Closed
jKelio opened this issue Sep 26, 2018 · 4 comments
Labels
area: elements Issues related to Angular Elements feature Issue that requests a new feature freq2: medium
Milestone

Comments

@jKelio
Copy link

jKelio commented Sep 26, 2018

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[X] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:

Current behavior

On implementing an optional custom strategy provider, when I create a new custom element with an angular component, I am forced to implement a complete new custom strategy provider with an own factory.

Expected behavior

But if I want to hook up a custom behavior to the default ComponentNgElementStrategy, I have to copy&paste the default class. Maybe it would be better, to import the default class that the custom element strategy could inherit from the default one.

Minimal reproduction of the problem with instructions

I have pushed an angular elements example with a custom behavior hooked up into the default copied and pasted ComponentNgElementStrategy on the connect method:
https://github.com/jKelio/angular-element-example

What is the motivation / use case for changing the behavior?

Avoiding too much coping&pasting stuff from the angular framework itself.

Environment


Angular version: 6.1.0
@kara kara added the area: elements Issues related to Angular Elements label Sep 26, 2018
@ngbot ngbot bot added this to the needsTriage milestone Sep 26, 2018
@remackgeek
Copy link
Contributor

This would be useful. While waiting for the zone changes to land, I had to do some hacky things to be able to wrap ComponentNgElementStrategy. See elements-zone-strategy

@andrewseguin andrewseguin added the feature Issue that requests a new feature label Dec 4, 2018
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Dec 4, 2018
remackgeek added a commit to remackgeek/angular that referenced this issue Jun 3, 2020
Adds ComponentNgElementStrategy, ComponentNgElementStrategyFactory to the public API,
allowing third-party libraries to extend the default strategy behavior

Fixes angular#26112, angular#33490
@totszwai
Copy link

We need this to workaround the issue mentioned in #29606

@gkalpak
Copy link
Member

gkalpak commented Jun 23, 2020

We have decided to not make ComponentNgElementStrategy part of the public API. See #37416 (comment) for more info.

If you need to define your own strategy, you can copy ComponentNgElementStrategy (and the corresponding factory).

@gkalpak gkalpak closed this as completed Jun 23, 2020
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jul 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: elements Issues related to Angular Elements feature Issue that requests a new feature freq2: medium
Projects
None yet
6 participants