Skip to content

Ability to pass data to a ComponentPortal #8322

@EdricChan03

Description

@EdricChan03

Bug, feature request, or proposal:

I'm trying to pass data to a portal (I'm using ComponentPortal), but so far, there's no possible way to do so.

What is the expected behavior?

Able to pass data to a ComponentPortal

What is the current behavior?

Can't pass data to a ComponentPortal

What are the steps to reproduce?

Providing a StackBlitz/Plunker (or similar) is the best way to get the team to see your issue.

Plunker starter (using on @master): https://goo.gl/uDmqyY

StackBlitz starter (using latest npm release): https://goo.gl/wwnhMV

What is the use-case or motivation for changing an existing behavior?

I want to show a code snippet with a param passed in as part of the code snippet.

Something like this:

<code-viewer language="html">
&lt;mat-icon svgIcon="{{selectedIcon}}"&gt;&lt;/mat-icon&gt;
</code-viewer>
export class CodeSnippetComponent {
    selectedIcon: string; // <- How to declare this?
}

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular v5.0.1
Angular Material v5.0.0-rc.0
Typescript 2.4.2
macOS High Sierra 10.13.1
Google Chrome Version 63.0.3239.30 (Official Build) beta (64-bit)

Is there anything else we should know?

NIL

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions