Skip to content

Angular Elements input is not defined on Init #29050

@qkhanhpro

Description

@qkhanhpro

🐞 bug report

Affected Package

The issue is caused by package @angular/elements

Is this a regression?

I'm not sure

Description

Passing a function into angular custom element, the input/component life cycle is different from normal angular component, causing some problems with apps dependent on the Input function at init.

I think the function passed down is not available at "OnInit" phase for the web element
but it's available for the Angular component

Following the provided stackblitz, only the web element throws the error.

🔬 Minimal Reproduction

https://stackblitz.com/edit/is-not-a-function

🔥 Exception or Error

preview-ee4d58d6ef0576b4e139b.js:1 TypeError: co.getString is not a function
at Object.eval [as updateRenderer] (HeartComponent.html:8)
at Object.debugUpdateRenderer [as updateRenderer] (services.ts:408)
at checkAndUpdateView (view.ts:368)
at callViewAction (view.ts:615)
at execComponentViewsAction (view.ts:559)
at checkAndUpdateView (view.ts:370)
at callWithDebugContext (services.ts:639)
at Object.debugCheckAndUpdateView [as checkAndUpdateView] (services.ts:345)
at ViewRef
.detectChanges (refs.ts:259)
at ComponentNgElementStrategy.detectChanges (component-factory-strategy.ts:251)

🌍 Your Environment

Angular Version:





@angular/common6.0.0-rc.4
@angular/compiler6.0.0-rc.4
@angular/core6.0.0-rc.4
@angular/elements6.0.0-rc.4
@angular/forms6.0.0-rc.4
@angular/platform-browser6.0.0-rc.4
@angular/platform-browser-dynamic6.0.0-rc.4
@angular/router6.0.0-rc.4
@webcomponents/custom-elements1.1.0
core-js2.5.4
rxjs6.0.0-rc.0
zone.js

Anything else relevant?
On my main project, using Angular V6.0.3, I experience the same behaviour...

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: elementsIssues related to Angular Elements

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions