• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/79

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

79 Cards in this Set

  • Front
  • Back

ng-src

Use it in

* What's the difference between ng-if and ng-show?

ng-if removes or adds dom elements. ng-show hides or reveals dom elements. ng-show uses CSS

* What are $even, $odd, $first, and $last?

a

* Why would you use ng-submit instead of ng-click in some cases?

ng-submit = forms, ng-click = a button or div.

Why use brackets in DI?

Allows code to be minified

$rootScope (what can you attach and why would you attach things to this?)(When should you attach things to it?)

Don't really attach things to $rootScope unless it is a pretty global feature like logging.

$index

{{$index}} gives you the index at the iteration of the loop you are in inside of ng-repeat

$log ($rootScope.$log)


$log.debug


$log.info


$log.warn


$log.info($event)

$event

This is the type of event being fired


ng-click="foo($event)"

$logProvider.debugEnabled(false);

Disables $log.debug

How to filter?

filter: expression (this can be a variable - bound to ng-model - or an object to allow you to filter a list of objects. {name: 'M', number: 1}


See docs

ng-bind vs ng-model

ng-bind - one way data binding


ng-model is intended for forms and uses two way data binding

ng-cloak

Makes it so you won't see flicker.

type friendly injections

Factories and Providers are NOT type friendly because their definition tends to be more dynamic in nature. The other types of services are more fixed and secure at runtime.

Differences between Factory, Service, Value, Constant, and Provider (When to use each?)

https://docs.angularjs.org/guide/providers

When to use Provider?

If you need a globally configurable service or one that is available in the config phase.

$templateCache

The first time a template is loaded it is stored in the templateCache. You can manually enter templates into the cache using $templateCache inside app.run or by putting a script tag somewhere where it is a child of ng-app.

$q.all (what, and when to use?)

a

Where to make network calls?


Alert error from network call - where to put it?

Error handling for http requests should be in your service. All of the heavy logic for your application should be in your services. Especially anything that has to do with data and data retrieval.

ng-style and ng-class?

The ngStyle directive allows you to set CSS style on an HTML element conditionally.


ngClass directive allows you to dynamically add and remove classes.

$http interceptors

Handles pre-processing of server requests.


Interceptors are service factories registered on $httpProvider

How to dynamically filter list?

a

ng-messages & ng-message

(form validation) (no complex ng-if sequence)


Used when displaying errors on a form

how attach something to header of every http call?

a

$on

a

$locationChangeStart

a

html5Mode

a

ui-router vs ngRoute

a

States?

a

How resolve resources via state/routes?

a

* Given 3 nested states, how would you load the most nested one after the root state resolves while allowing the middle state to load asynchronously?

a

$destroy

a

one time binding

a

When and where use $watch?

Use it rarely. Whenever you want a variable watched. $scope.$watch('myVar', function(){......

stateful vs stateless filter

Filters should be stateless. aka they shouldn't have external dependencies. Everything needed should be passed in as an argument.

* What are $dirty, $pristine, $valid, $invalid, and $submitted?

a

NgModelController

a

FormController

a

ng-model-options

a

What are $validators and $asyncValidators?

a

scope and $scope?

scope is directive property and $scope is angular?

controller and link directives?

a

How do you require controllers in directives?

a

isolated scope?

a

?,@,=,&,* ?

a

* What are compile/pre-link/post-link phase for directives?

a

* What is $interpolate?

a

* What is $compile?

a

* What is $observe?

a

* What's bindToController and controllerAs syntax?

a

* What are directives and what are components?

a

$broadcast vs $emit

One sends message up chain the other down.

* What are $timeout and $interval and how do you cancel them?

$timeout is setTimeout but with an automatic $scope.$apply wrapper around the callback function.

* What's dirty checking? (Does anyone else use it?)

React, Polymer

* What is the $digest loop?

a

$digest and $apply?

$apply manually triggers the digest cycle. Pass a function in as an argument and after that function evaluates the digest cycle will be called. A call will be made to $rootScope.$digest


Always use $apply(foo) form and not $scope.$apply() with no arg. This is because any exceptions in the former will be passed to $exceptionHandler. Don't call $rootScope.$digest manually.


$digest runs at least twice.


Minimize model changes in listeners so $digest doesn't keep looping.



http://www.sitepoint.com/understanding-angulars-apply-digest/

$watchGroup and $watchCollection?

a

$eval, $parse and $evalAsync?

a

$applyAsync?

a

* What's a decorator?

http://plnkr.co/edit/lj9srM2KXZmwmTxLb1p7?p=preview



app.config(function($provide){



$provide.decorator('serviceName', function($delegate){



$delegate refers to the original service. You can modify methods and properties of the original object.

* How would you grab the $injector/$scope from the chrome console?

a

* Why is there ng-form?

a

* How would you dynamically create forms?

a

* What's CSP and how does it relate to angular?

a

* How do you structure your files for a large team/project?

a

* How would you use a module loader/bundler such as browserify, webpack, or systemjs with angular?

a

* How would you asynchronously load angular?

a

* How would you inject server rendered data into angular?

b

* What is needed for your angular web app to work with JavaScript disabled?

b

* What is needed for your angular web app to be rendered on the server to be sent down to the client for FastBoot?

b

* Generally speaking how would you paraphrase angular?

b

* How would you progressively enhance your RESTful app with a pub/sub?

b

* How would you structure your app if you only had a realtime (pub/sub) API (no REST)?

b

* What are the different ways to architect your angular app?

b

* What are some anti patterns developers tend to fall into while using angular?

b

* What are the problems currently facing angular1?

b

* Explain how Angular2 is solving all of the problems from 1.x

b

What's new in 1.3

$stateful

What is dirty checking?

b