Modules Flashcards

1
Q

What are NgModules?

A

They are containers for a cohesive block of code dedicated to an application domain, workflow or closely related set of capabilities

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What can NgModules contain?

A

components, service providers and other code files whose scope is defined by the containing NgModule

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How is the AppModule defined?

A

import { BrowserModule } from ‘@angular/platform-browser’;

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpClientModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Every angular app has at least one root module. How is it named? And where does it resides

A
  1. AppModule

2. app.module.ts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is @NgModule() and why do we need it?

A

@NgModule() is a decorator function. We need it to pass metadata configuration for the module

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Regarding NgModule metadata.

What is the property declarations?

A

The components, directives, and pipes that belong to the NgModule

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Regarding to NgModule metadata.

What is the exports property?

A

a subset of declarations that should be visible and usable by other components

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Regarding NgModule metadata.

What is the imports property?

A

others modules whose exported classes are needed in the current module

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Regarding NgModule metadata.

What is the providers property?

A

Creators of services

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Regarding NgModule metadata.

What is the bootstrap property?

A

The app main view, root component. Only the root NgModule should set the bootstrap property

How well did you know this?
1
Not at all
2
3
4
5
Perfectly