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

A

False

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.

A

false

25
Q

HTML annotations that trigger JS behaviors

A

Directives

26
Q

ng-app

A

attaches the App Module to a page (root of the app)

27
Q

ng-controller

A

attaches a Controller function to the page

28
Q

ng-model

A

binds the form element value to the property (i.e. ng-model=“review.stars”)

29
Q

ng-include

A

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
Q

Custom Directives

A
  • Register handlers
  • Express complex UI
  • Call events
  • Reuse components
31
Q

Custom Directives Types

A
  1. Element - used for UI widgets, restrict: ‘E’
  2. Attribute - used for mixin behaviors, restrict: ‘A’
32
Q

Module

A

A “container” where all Angular components live

33
Q

What is an Angular Expression?

A

How we display values on a page {{values}}

34
Q

What are Angular expressions evaluated against?

A

The scope object

35
Q

What errors will a bad Angular expression give?

A

They are forgiving and evaluated to null or undefined.

36
Q

How can you format data in an Angular expression?

A

Filters

37
Q

Filter

A
  • denoted by “pipe”
  • allows filtering and formatting of data
  • {{data | filter:options }}
38
Q

”@” Directive Bindings

A
  • passing strings
  • supports {{}} expressions
  • expressions evaluated against directive’s parent scope
39
Q

”=” Directive Bindings

A
  • two-way model binding
  • parent scope linked to model in directive’s isolated scope
40
Q

“&” Directive Binding

A
  • passing callback method to directive
  • method is pre-bound to directive’s parent scope
  • call $scope.hello({name:’world’})
41
Q

Name the three Directive Bindings

A
  • @ string
  • = model
  • & method
42
Q

Directives should _____ after themselves. How?

A
  • “clean-up”
  • scope.$on($destroy, …);
  • forces directive to be destroyed during garbage collection