question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

feat(DomPortalOutlet): Alternative constructor (ComponentFactoryResolver is deprecated)

See original GitHub issue

Feature Description

@angular/angular deprecated ComponentFactoryResolver in 13.2.0:

https://github.com/angular/angular/blob/master/CHANGELOG.md#1320-2022-01-26

When using a lint rule such as deprecation/deprecation users of DomPortalOutlet now get a warning due to the constructor requiring a ComponentFactoryResolver

Use Case

https://github.com/angular/components/blob/aea5d136068798e8655a9fecaaabd6cb73cb8ab5/src/cdk/portal/portal.spec.ts#L423-L438

I am not sure if the tslint deprecation rule is enabled in this repository (it is not in tslint.json here) but I presume it would warn on the above tests.

It would be nice to not require an

    // eslint-disable-next-line deprecation/deprecation
    private componentFactoryResolver: ComponentFactoryResolver

in my code, and presumably the Angular team is planning on removing this at some point.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:19
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
angular-robot[bot]commented, Mar 14, 2022

This feature request is now candidate for our backlog! In the next phase, the community has 60 days to upvote. If the request receives more than 20 upvotes, we’ll move it to our consideration list.

You can find more details about the feature request process in our documentation.

0reactions
angular-robot[bot]commented, Apr 23, 2022

Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.

Find more details about Angular’s feature request process in our documentation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Replace deprecated Angular ComponentFactoryResolver ...
In Angular 13 the new API removes the need for ComponentFactoryResolver being injected into the constructor, like you did in your code.
Read more >
Portal - Angular Material
Alternate ComponentFactoryResolver to use when resolving the associated component. Defaults to using the resolver from the outlet that the portal is ...
Read more >
Inject dynamic content in Angular components with portals
Portal provides a flexible and clean alternative method of injecting content into an ... constructor( private cfr: ComponentFactoryResolver, ...
Read more >
Falcon Sandbox v8.31 © Hybrid Analysis
constructor () { ... Pattern match: "https://caniuse.com/#feat=css-media-resolution\n" ... Hover mixin and `$enable-hover-media-query` are deprecated.
Read more >
node_modules/@angular/material/bundles/material.umd.js.map
*/\n private _leavingSub: Subscription;\n\n constructor(\n _componentFactoryResolver: ComponentFactoryResolver,\n _viewContainerRef: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found