Angular1 - Language Features Flashcards

1
Q

URL routing is a popular approach to matching the contents of a URL to specific functionality within a web application.

A

True

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

URL routing is a popular approach to matching the contents of a URL to specific functionality within a web application.

A

True

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

___ is an example of an element directive

A

“<mydirective></mydirective>”

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

Angular doesn’t supply URL routing by default.

A

True

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

Once you have a Promise, what can you attach?

A

finally() method

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

Like ngBindTemplate, ngBind can have multiple {{ }} Expressions

A

False

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

When using a filter with arguments, what is the result of using the following filter? {{1234.5678|number:5}}

A

1,234.56780 Rounds to 5 places

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

The directive normalization process strips what from the front of the element?

A

x- and data-

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

What are the phases that every module goes through?

A

config phase, run phase

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

How can you get the current url from browser?

A

$location.path()

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

What does the $locationProvider do?

A

Helps configure deep linking within the app

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

You should use the ng-app directive when manually bootstrapping your app.

A

false

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

You should use the ng-app directive when manually bootstrapping your app.

A

false

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

___ is an example of an element directive

A

<mydirective></mydirective>

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

Angular doesn’t supply URL routing by default.

A

True

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

Once you have a Promise, what can you attach?

A

finally() method

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

Like ngBindTemplate, ngBind can have multiple {{ }} Expressions

18
Q

When using a filter with arguments, what is the result of using the following filter? {{1234.5678|number:5}}

A

1,234.56780 Rounds to 5 places

19
Q

Custom Directives Types

A
  • Element - used for UI widgets, restrict: ‘E’
  • Attribute - used for mixin behaviors, restrict: ‘A’
20
Q

What are the phases that every module goes through?

A

config phase, run phase

21
Q

How can you get the current url from browser?

A

$location.path()

22
Q

What does the $locationProvider do?

A

Helps configure deep linking within the app

23
Q

What is the difference between $location and window.location?

A

$location allows seamless integration with HTML 5 API while window.location does not.

24
Q

You should use the ng-app directive when manually bootstrapping your app.

25
HTML annotations that trigger JS behaviors
Directives
26
ng-app
attaches the App Module to a page (root of the app)
27
ng-controller
attaches a Controller function to the page
28
ng-model
binds the form element value to the property (i.e. ng-model=“review.stars”)
29
ng-include
allows us to package a chunk of html and include it in our page fetched via AJAX request) i.e. ng-include = “‘chunk.html’”
30
Custom Directives
* Register handlers * Express complex UI * Call events * Reuse components
31
Custom Directives Types
1. Element - used for UI widgets, restrict: 'E' 2. Attribute - used for mixin behaviors, restrict: 'A'
32
Module
A "container" where all Angular components live
33
What is an Angular Expression?
How we display values on a page {{values}}
34
What are Angular expressions evaluated against?
The scope object
35
What errors will a bad Angular expression give?
They are forgiving and evaluated to null or undefined.
36
How can you format data in an Angular expression?
Filters
37
Filter
* denoted by "pipe" * allows filtering and formatting of data * {{data | filter:options }}
38
"@" Directive Bindings
* passing strings * supports {{}} expressions * expressions evaluated against directive's parent scope
39
"=" Directive Bindings
* two-way model binding * parent scope linked to model in directive's isolated scope
40
"&" Directive Binding
* passing callback method to directive * method is pre-bound to directive's parent scope * call $scope.hello({name:'world'})
41
Name the three Directive Bindings
* @ string * = model * & method
42
Directives should _____ after themselves. How?
* "clean-up" * scope.$on($destroy, ...); * forces directive to be destroyed during garbage collection