Typing Injected Dialog Data causes compile error with aot
See original GitHub issueWhat is the expected behavior?
Compiles successfully
What is the current behavior?
Metadata collected contains an error that will be reported at runtime: Expression form not supported.
What are the steps to reproduce?
Create a dialog component that receives data from the caller. Typing the data will result in an error.
@Inject(MAT_DIALOG_DATA) public data: {user: User};
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
"@angular/common": "^7.0.0", "@angular/core": "^7.0.0", "@angular/material": "^7.3.7", "@angular/cdk": "^7.3.7",
Is there anything else we should know?
Workaround is to remove the typing or add a // @dynamic about the component decorator.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
I can't inject MAT_DIALOG_DATA! Error - Stack Overflow
My program Compiles successfully but inside the browser, the program stops working and show the error from the error. Uncaught Error: inject() ...
Read more >AOT metadata errors - Angular
The compiler encountered a referenced to a locally defined symbol that either wasn't exported or wasn't initialized. Here's a provider example of the...
Read more >Angular Dynamic Components: Building a Dialog System
In this tutorial, you will learn what dynamic components are and how they work in angular. You will do so by creating a...
Read more >Changelog | Burst | 1.6.6 - Unity - Manual
Fixed a bug where using ReinterpretStore(someIndex, (ushort)someValue) could cause an internal compiler error in Burst.
Read more >Replace JavaScript Dialogs With the New HTML Dialog Element
Then it hit me: you get a lot of modal-related features for free with alert() , confirm() , and prompt() that often go...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Skip the injection and set your data manually via the reference component instance (before subscribing). You could even wrap the whole thing with a static helper.
then call from your component…
I’m facing a similar issue not only AOT but also JIT.