Angular2 - Language Features Flashcards

1
Q

Root of the application

A

AppComponent

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

AppComponent is the ____ of the application. It hosts the ___ ____ experience.

A

root, client user

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

Components

A

basic building blocks of Angular2 app

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

Component controls a ____ through its associated ____

A

view, template

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

_______ controls a view through its associated template

A

A component

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

@Component decorator

A

which template to use and how to create it

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

@Component contains ______ that tells which template to use and how to create the component.

A

metadata

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

@Component - Selector

A

specifies CSS selector for an HTML element

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

@Component - TemplateUrl, Template

A

html file/an html string

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

@Component - Directives

A

array for injecting other components

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

@Component - Providers

A

where services are registered

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

App.component.ts

A

Contains

  • import statements
  • @Component decorator
  • component class
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Component class

A
  • “controller” that controls appearance and behavior of a view through the template
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

AppComponent

A
  • AppComponent is exported, to be imported somewhere else

- located in App.component.ts

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

Main.ts

A

bootstraps the app

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

Main.ts - bootstrap function

A
  • called by Angular
    1) reads AppComponent (root component)
    2) finds my-app selector
    3) locates my-app element
    4) renders the app between my-app tags
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

index.html

A
  • defines the web page that hosts the app

- contains all of the script tags

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

SystemJS

A
  • module loader
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Data Binding:

{{someproperty}}

A
  • one-way data binding

- also called interpolation

20
Q

Data Binding:

ngModel = [{someproperty}]

A

two-way data binding

21
Q

Property Binding:

[targetproperty] = “sourceProperty”

A

one-way data flow, from data source to a class property

22
Q

What are the three types of Directives in Angular2?

A

Component, Structural, and Attribute

23
Q

What is a Component Directive?

A

A directive with a template

24
Q

What is a Structural Directive?

A
  • A directive that changes the DOM

- i.e. NgFor and NgIf

25
What is an Attribute Directive?
- A directive that changes the appearance/behavior of an element - i.e. NgStyle
26
*ngFor
iterates over an array
27
template input variable
directive that can be referenced inside a template
28
(click)
same as ngClick
29
Services
- registered in @Component Providers
30
What is a Promise?
- an async call that promises to send results when they're ready - the promise's "then" function takes our callback
31
What are Lifecycle Hooks?
- allows access to certain events in the lifecycle of a component - i.e. creation, change, destruction
32
What are some examples of Lifecycle Hooks?
ngOnInit ngOnChanges ngDoCheck ngOnDestroy
33
Angular2 default couter
Component Router
34
What does a route definition contain?
path: URL component: the component to create when navigating
35
Router Outlet
tags at the bottom of a template which tells the router where to display associated components
36
Router Link
37
Route Parameter
data you want available to a routes component | path: 'detail/:id'
38
What are pipes?
- a way to format strings and dates | - {{selectedHero.name | uppercase}} is my hero
39
What is Angular2's http library?
HTTP_PROVIDERS
40
What is HTTP_PROVIDERS?
library that contains providers for all http services
41
What are Observables?
- a collection of data | - a way to manage asnc data flow
42
What is a template string?
- a string that contains html elements, used in a component
43
ES2015 allows for multi-line strings using ____
backticks
44
ES2015 allows for ______ strings using backticks.
multi-line
45
What is Master/Detail?
A UI pattern consisting of a list with drill-down views
46
___ creates block-scoped variables
let
47
let creates ______ variables
block-scoped