Angular Flashcards

1
Q

Using model variable in HTML

A

{{name}}

  • if name is updated in input field, its value is displayed immediately on the html page.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Using expression in HTML

A

{{expression}}

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

Form validation

A

When angular validates forms, standard HTML validation should be switched off with form:novalidation attribute.

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

form.FormController

A

Keeps track of all its controls and nested forms as well as the state of them, such as being valid/invalid or dirty/pristine.

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

$scope

A

Use in controllers. Access variables in HTML through this object. For example, $scope.name, etc.

  • This is how you can alter the content of the page.

gTrack.controller(‘ControllerName’, function($scope) {});

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

$scope.$on

A

Execute function when a specific event occures.

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

$scope.$on(‘$viewContentLoaded’, )

A

Execute function when the view has been loaded.

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

$location

A

A service. Sets/gets the url in te browser. So, good for redirecting.

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

$rootScope

A

Available for all views.

  • Problematic memory wise, use as little as possible
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Execute something when an event happens

A

$rootScope.$on(‘event name’, function() )

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

Watch for changes a user variable

A

$scope.$watch ‘variable’ ->

do something

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

Parameters in URL-s: in HTML

A

ng-href=”#/checkins/{{a}}/{{b}}”

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

Parameters in URL-s: in route

A

/checkins/:a/:b

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

Parameters in URL-s: in controller

A

use $routeParams service

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

keyAt

A

Returns the Firebase key for a record in the array.

  • accepts either an array index
  • or a reference to an item that exists in the array
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Role of $provide is:

A

registering components with the $injector.

17
Q

When requesting a service, $injector is responsible for (3 things):

A
  • find the correct service provider
  • instantiate the service
  • call its $get service factory function to get an instance of the service
18
Q

A service is:

A
  • a singleton object, created by a service factory
19
Q

A service factory is:

A
  • a function that is created by a service provider
20
Q

A service provider is:

A
  • a constructor function

- They must contain a $get property that holds the service factory function.