I am new in Angular, I am using Angular 4, and I made an app using the Angular CLI, by ng new
command.
In main.ts, we have
...
import
The body of the class is indeed empty. But that decorator above the class (@NgModule
) is giving that class its functionality. So really, that class isn't empty. It just doesn't require any extra logic after the decorator is applied to it. bootstrapModule
takes a class as input and assumes that that class is decorated with @NgModule
configured in a manner similar to what you have (declarations, imports, providers, etc.).