Skip to content

Ivy is not liking the @Host() decorator #31539

@p3x-robot

Description

@p3x-robot

🐞 bug report

Affected Package

The issue is caused by package @angular/....

@Host() decorator is not working with Ivy.

Description

A clear and concise description of the problem...

I was using this (now I have to use a global variable to get this host as Ivy is not liking it):

🔬 Minimal Reproduction

import {Layout} from '../layout/cory-layout';

 constructor(
        @Host() public parent: Layout,
        public sanitize: DomSanitizer,
        protected locale: LocaleService,
    )

🔥 Exception or Error


core.js:7383 ERROR Error: NodeInjector: NOT_FOUND [cory_layout_Layout]
    at getOrCreateInjectable (core.js:7166)
    at Object.ɵɵdirectiveInject (core.js:14735)
    at NodeInjectorFactory.factory (cory-page.ts:44)
    at getNodeInjectable (core.js:7261)
    at core.js:11972
    at createRootComponent (core.js:18137)
    at ComponentFactory.create (core.js:22946)
    at ViewContainerRef_.createComponent (core.js:19384)
    at RouterOutlet.activateWith (router.js:5194)
    at RouterOutlet.ngOnInit (router.js:5116)

🌍 Your Environment

Angular Version:

8.1.0

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions