Created
September 29, 2019 06:38
-
-
Save omar-dulaimi/d1cca682784f580e7e5ce941b4af0a33 to your computer and use it in GitHub Desktop.
Angular Expression form not supported
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Solution: | |
| Got this problem. | |
| Added // @dynamic before the class that declares static method: | |
| // @dynamic | |
| export class SomeClass { | |
| public static get() { return 'someValue'; } | |
| } | |
| I believe that static methods within classes are used ie for "MyModule.forRoot()", and angular thinks you are defining a module. As your function would not be compatible with AOT, it compilation fails, and the // @dynamic directive is like "don't worry Angular, this class is not intented to be used for bootstapping some modules." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment