Week 9 QC Angular Quiz Multiple Choice Flashcards
What type of object do the request methods of the HttpModule return?
Observable Promise Request Response
Observable
Which of the following is valid usage of the get() method? (Choose all that apply)
http.get(url); http.get(url, requestOptions); http.get(url, requestOptions, body); http.get(url, body, requestOptions);
http.get(url, requestOptions);
Which function does the Response object provide to help handle errors?
json().data json() catch() handle() errors()
catch()
Which of the following files provides compilation information for an Angular2 application?
app.component.ts app.module.ts main.ts main.css
main.ts
Explanation : main.ts specifies how to compile the application and specifies the main module.
Which of the following files is typically used to link your application’s components?
app.component.ts app.module.ts main.ts main.js
app.module.ts
Explanation : app-module.ts defines the AppModule component. It is the root module and will link all other components of your application here
Data-binding is: (Choose the best option to complete this sentence)
the association of data/events with elements and user interactions
elements, attributes and CSS style classes that you bind on your HTML templates
a set of instructions solely dedicated towards presentation logic
a collection of data values that you pass to a component
the association of data/events with elements and user interactions
Metadata is: (Choose the best option to complete the sentence)
the association of data/events with elements and user interactions elements, attributes and CSS style classes that you bind on your HTML templates a set of instructions solely dedicated towards presentation logic a collection of data values that you pass to a component
a collection of data values that you pass to a component
Services are: (Choose the best option to complete this sentence)
elements, attributes and CSS style classes that you bind on your HTML templates
a set of instructions solely dedicated towards presentation logic
a collection of data values that you pass to a component
features or values that you want defined in one location but in general are used throughout your application
features or values that you want defined in one location but in general are used throughout your application
Interpolation is: (Choose the best option to complete the sentence)
a way to display data from your Angular code on your templates
a set of instructions solely dedicated towards presentation logic
a collection of data values that you pass to a component
the association of data/events with elements and user interactions
a way to display data from your Angular code on your templates
Assume you have the following code:
@Component {
selector: ‘my-app’,
template: ‘<h1>Hello [interpolation here] </h1>’
}
export class Component AppComponent {
name = ‘World’;
}
Which of the following is the best way to use interpolation to present the name property in the space [interpolation here]?
{{ name }}
{{ person.name }}
{ person.name}
{ name }
{{ name }}
Which properties do you specify on @NgModule? (Choose all that apply)
definitions
components
declarations
services
imports
imports
Explanation : Correct. The three main properties that you specify inside @NgModule are declarations, bootstrap and imports. There are others used for specifying services and other constructs. Definitions, components and services, however, are not valid properties of @NgModule
declarations
Explanation : Correct. The three main properties that you specify inside @NgModule are declarations, bootstrap and imports. There are others used for specifying services and other constructs. Definitions, components and services, however, are not valid properties of @NgModule
Which of the following decorators is the one used to specify metadata for the root module?
@NgModule
@Module
@Component
@Injectable
@NgModule
Which of the following are specified as part of the declarations property of @NgModule? (Choose all that apply)
components directives pipes services other modules
components
directives
Which of the following are specified as part of the imports property of @NgModule? (Choose all that apply)
components
directives
pipes
services
other modules
other modules
Which of the following snippets correctly uses event-binding according to Angular 2 syntax:
…
…
…