Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Accesing a dynamic component #4

@st-clair-clarke

Description

@st-clair-clarke

Hi,
Given the following:

@Component({
  selector: 'my-app',
  templateUrl: './app.component.html',
  styleUrls: [ './app.component.css' ]
})
export class AppComponent  {
  name = 'Angular 6';
  component = DynamicComponent;
  onClick($event) {
    alert($event);
  }
}

How do I access the instance of the DynamicComponent to set a property?
Attempting access in a @ViewChild() does not seem to work.

NB. I note that the docs state that there is access to the component? I can't seem to get it though

Metadata

Metadata

Assignees

No one assigned

    Labels

    need docThat issue should be shown in documentationresolvedThat issue was resolved

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions