What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Angular NG1001 means an affected decorator received something other than an object literal as its argument. To fix it, put the metadata object directly inside the decorator call instead of passing a variable that holds the object.
What does Angular NG1001 mean?
NG1001 is Angular’s compiler error named “Argument Not Literal.” It applies when an affected decorator’s argument is not an object literal. Angular’s NG1001 guidance identifies the affected decorators as @NgModule, @Pipe, @Component, @Directive, and @Injectable.
For example, passing a variable that contains decorator metadata does not meet the documented requirement, even if that variable evaluates to an object. The object literal must appear directly as the decorator argument.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11How do you fix NG1001?
-
Find the decorator named in the compiler diagnostic.
#1 Best Overall
-
Check whether its argument is a variable reference or another expression rather than an inline object literal.
-
Move the metadata object into the decorator call, then rebuild and review any follow-on compiler diagnostics.
For example, change a variable-based call such as @NgModule(moduleDefinition) to an inline form such as @NgModule({ declarations: [AppComponent] }). Keep the metadata values your application needs; the important change is that the object literal itself is now the decorator argument.
Recommended Free Tools
Why does Angular require a literal in a decorator?
Angular says the restriction makes compiler metadata extraction faster. Its documentation describes the stricter requirement as an intentional Ivy change: Ivy compiles decorators by moving expressions into other locations in the class output. The Angular Error Encyclopedia lists NG1001 as a compiler error.
Rank #3
The cited Angular guidance does not specify a release boundary or establish that every non-literal expression behaves identically across all compiler and Angular versions. If inlining the object does not resolve the diagnostic, use the exact compiler message to check the decorator and argument it identifies.
Quick Recap
Rank #4
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

