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
Q

What is an Attribute Directive?

A
  • A directive that changes the appearance/behavior of an element
  • i.e. NgStyle
26
Q

*ngFor

A

iterates over an array

27
Q

template input variable

A

directive that can be referenced inside a template

28
Q

(click)

A

same as ngClick

29
Q

Services

A
  • registered in @Component Providers
30
Q

What is a Promise?

A
  • an async call that promises to send results when they’re ready
  • the promise’s “then” function takes our callback
31
Q

What are Lifecycle Hooks?

A
  • allows access to certain events in the lifecycle of a component
  • i.e. creation, change, destruction
32
Q

What are some examples of Lifecycle Hooks?

A

ngOnInit
ngOnChanges
ngDoCheck
ngOnDestroy

33
Q

Angular2 default couter

A

Component Router

34
Q

What does a route definition contain?

A

path: URL
component: the component to create when navigating

35
Q

Router Outlet

A

tags at the bottom of a template which tells the router where to display associated components

36
Q

Router Link

A

<a>Heroes</a>

37
Q

Route Parameter

A

data you want available to a routes component

path: ‘detail/:id’

38
Q

What are pipes?

A
  • a way to format strings and dates

- {{selectedHero.name | uppercase}} is my hero

39
Q

What is Angular2’s http library?

A

HTTP_PROVIDERS

40
Q

What is HTTP_PROVIDERS?

A

library that contains providers for all http services

41
Q

What are Observables?

A
  • a collection of data

- a way to manage asnc data flow

42
Q

What is a template string?

A
  • a string that contains html elements, used in a component
43
Q

ES2015 allows for multi-line strings using ____

A

backticks

44
Q

ES2015 allows for ______ strings using backticks.

A

multi-line

45
Q

What is Master/Detail?

A

A UI pattern consisting of a list with drill-down views

46
Q

___ creates block-scoped variables

A

let

47
Q

let creates ______ variables

A

block-scoped