Skip to content

Instantly share code, notes, and snippets.

@omar-dulaimi
Created September 29, 2019 06:38
Show Gist options
  • Select an option

  • Save omar-dulaimi/d1cca682784f580e7e5ce941b4af0a33 to your computer and use it in GitHub Desktop.

Select an option

Save omar-dulaimi/d1cca682784f580e7e5ce941b4af0a33 to your computer and use it in GitHub Desktop.
Angular Expression form not supported
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