Skip to content

Instantly share code, notes, and snippets.

@paveltimofeev
Last active April 14, 2021 06:05
Show Gist options
  • Save paveltimofeev/b59cecd4efba6fc9e2c540cdb9a00dfd to your computer and use it in GitHub Desktop.
Save paveltimofeev/b59cecd4efba6fc9e2c540cdb9a00dfd to your computer and use it in GitHub Desktop.
Angular Tricks

Angular tricks

How to get ref of parent component

@Component({
    selector: 'app-my-child',
    templateUrl: './app-my-child.component.html'
})
export class MyChildComponent {

    constructor (
        @Inject(forwardRef(() => MyParentComponent)) public parent: MyParentComponent,
    ) {
        /// parent.
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment