Recall & Review
beginner
What is the purpose of the root module (AppModule) in an Angular application?
The root module, called AppModule, is the main module that Angular uses to bootstrap and launch the application. It organizes components, services, and other modules needed at startup.
Click to reveal answer
beginner
Which decorator is used to define the root module in Angular?
The @NgModule decorator is used to define the root module. It contains metadata like declarations, imports, providers, and bootstrap arrays.
Click to reveal answer
intermediate
Name the four main properties inside the @NgModule decorator in the root module.
The four main properties are: declarations (components, directives, pipes), imports (other modules), providers (services), and bootstrap (root component to start).
Click to reveal answer
beginner
What does the bootstrap array in AppModule do?
The bootstrap array lists the root component(s) Angular should load and render first when the app starts, usually the AppComponent.
Click to reveal answer
intermediate
Why should the root module import BrowserModule?BrowserModule provides services needed to run the app in a browser, like rendering and event handling. It must be imported once in the root module.
Click to reveal answer
Which decorator defines an Angular module?
✗ Incorrect
The @NgModule decorator is used to define modules, including the root module.
What is the main component listed in the bootstrap array of AppModule?
✗ Incorrect
AppComponent is the default root component bootstrapped by Angular.
Which module must be imported in the root module to run the app in a browser?
✗ Incorrect
BrowserModule provides essential services for browser apps and is imported once in the root module.
Where do you declare components used in the root module?
✗ Incorrect
Components, directives, and pipes are declared in the declarations array.
What is the role of the providers array in AppModule?
✗ Incorrect
The providers array registers services that can be injected throughout the app.
Describe the structure of the root module (AppModule) in Angular and explain the purpose of each main property in the @NgModule decorator.
Think about how Angular organizes app parts in the root module.
You got /5 concepts.
Explain why BrowserModule is important in the root module and what would happen if it was missing.
Consider what Angular needs to display your app in a web browser.
You got /4 concepts.