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:
…
…
…
Which of the following correctly uses property binding:
<img></img>
<img></img>
<img></img>
<img></img>
<img></img>
<img></img>
Which of the following are attribute directives? (Choose all that apply)
ngModel
ngClass
ngFor
ngIf
ngModel
ngClass
Which of the following libraries defines the @Component decorator? (Choose the best option)
@angular/core
@angular/http
@angular/component
@angular/directives
@angular/core
Explanation : Correct. The @angular/core library defines the @Component decorator
Which of the are valid properties of the @Component decorator? (Choose all that apply)
selector
template
id
animations
templateUrl
selector
template
templateUrl
Which of the following metadata specifies the path to the file that defines the HTML to output?
animations
exportAs
providers
template
templateUrl
templateUrl
Which module defines functionality for running your application in a web browser? (Choose the best option)
HTTPModule BrowserModule AJAXModule HTMLModule
BrowserModule
What is the result of {{ “1 + 9” }}?
1 FALSE 1 + 9 10
1 + 9
Which of the following languages does Angular 2 employ? (Choose the best answer)
JavaScript TypeScript Java ActionScript VBScript
TypeScript
In Angular, a router module is
An injectable singleton composing related application logic. A file used to declare the various files that make up an Angular module. A modularized portion of a user interface, composed of template, styles, and a TypeScript class. A TypeScript object that defines how various URLs map to views.
A TypeScript object that defines how various URLs map to views.