Same as ng-class, but will only take effect on even rows.
Back
ng-csp
Front
Changes the content security policy.
Back
How event binding works?
Front
Event binding allows us to listen any DOM event and call a component method when it's triggered.
To capture an event from our template, we wrap the name of the event we want to listen to in a parentheses and specify the method to call.
Any event can be listened without the "on": mouseover, blur, submit.
(click)="doThis($event)" // event object can be accessed
Back
ng-copy
Front
Specifies a behavior on copy events.
Back
ng-hide
Front
Hides or shows HTML elements.
Back
How to add html and css to our Component from a template?
Front
On Component add attributes: TemplateUrl: '...' and styleUrls: ['...'] with path to the template files.
Back
ng-bind-template
Front
Specifies that the text content should be replaced with a template. Unlike the ng-bind, this can take multiple {{}} elements. (ng-bind just takes the string itself)
Back
Why is it good that the css is scoped to the Component?
Front
Adds a custom attribute to the html and css too.
If we would reuse this class ".description" on an other component they wouldn't clash, they all scoped to the directive.
Back
ng-checked
Front
Specifies if an element is checked or not.
Back
ng-jq
Front
Specifies that the application must use a library, like jQuery.
Back
How to import Class B to an other file?
Front
In order for Class B to be imported into another file, Class B needs to use the
export keyword.
Back
What is SystemJs used for?
Front
Is a JS library that allows us to import other libraries.
Back
ng-form
Front
Specifies an HTML form to inherit controls from.
Back
What is the decorator function?
Front
Adds more behavior to our class from outside of our class.
If must be declared immediately before the class.
The decorator turns our old JS class into a component.
import { bootstrap } from '@angular/platform-browser-dynamic';
import { Component } from '@angular/core';
//COMPONENT TOP
@Component({//apply our comp. decorator to our class
selector: 'my-app', // custom html selector where we want our component to load
template: '<h1>...</h1>' // content
})
//COMPONENT BOTTOM
class AppComponent { }
bootstrap(AppComponent) // instantiate app
Back
ng-disabled
Front
Specifies if an element is disabled or not.
Back
ng-cut
Front
Specifies a behavior on cut events.
Back
How class property binging works?
Front
Class binding allows us to specify a CSS class to a DOM element if a component property is true.
[class.featured]="part.featured"
If the value is true the class added, otherwise it's removed.
Note that the html element and the class are properly scoped.
If you bind directly to the class element property, it will overwrite all classes. [class]="property"// not a good practice
Back
ng-include
Front
Includes HTML in an application.
Back
What are the ways to access latest version of JS ES6?
Front
- Babel (transpile: it gets changed into JavaScript)
- TypeScript (superset of js transpile)
Back
What is two-way binding? How to bind data both ways?
Front
Two-way binding means that if the component property is modified inside the component (JavaScript) or inside our web page (HTML), it will stay in sync.
1: Bind the input value to a property. We need to listen for the input event on our input box.
<input type="text"
[value]="part.qty"
(input)="part.qty =$event.target.value"
2: Using [(ngModel)] allows us to have one command to express two-way data binding.
You can only use it for data bound properties, like form fields. It won't work if you use it for a method.
<input type="text" [(ngModel)]="part.qty">
Back
ng-keypress
Front
Specifies a behavior on keypress events.
Back
That is the import and what bootstrap function used for?
Use pipe: Takes in data as input and transforms it to a desired output. (lowercase, date, number, decimal, replace, slice, json)
You can create your custom pipes.
Back
ng-focus
Front
Specifies a behavior on focus events.
Back
What are the difference between Angular 1 and Angular 2?
Front
- Speed
- Components vs controllers and scope
- Simpler directives
- Intuitive data binding
- Services are now just a class
Back
ng-class-odd
Front
Same as ng-class, but will only take effect on odd rows.
Back
ng-cloak
Front
Prevents flickering when your application is being loaded.
Back
ng-app
Front
Defines the root element of an application.
Back
ng-keyup
Front
Specifies a behavior on keyup events.
Back
ng-init
Front
Defines initial values for an application.
Back
ng-if
Front
Removes the HTML element if a condition is false.
Back
What is Component?
Front
Basic building blocks, controls a portion of the screen. It's a directive with a template. Easily nest one inside the other.
In Angular, we add dynamic behavior to HTML using
directives.
Back
ng-bind-html
Front
Binds the innerHTML of an HTML element to application data, and also removes dangerous code from the HTML string.
Back
How property binging works?
Front
Property binding allows us to glue component properties to any DOM element properties.
[src]='part.image'
The square brackets tell Angular to set this DOM element property to our component property. If the component property changes, update this DOM. (one-way binding)
Back
What services are used for?
Front
To organize and share code across your app, and where we create our data access methods. http calls
Back
ng-click
Front
Specifies an expression to evaluate when an element is being clicked.
Back
What is the observable in http calls?
Front
Our http calls return an observable, not a promise, which behaves more like an array.
Back
ng-keydown
Front
Specifies a behavior on keydown events.
Back
ng-class
Front
Specifies CSS classes on HTML elements.
Back
ng-bind
Front
Binds the content of an HTML element to application data. Pretty much the same as {{}} (curly markup -- which is generally preferable because it is less verbose) but can be useful if template is displayed in it's raw state before angular compiles -- because ng-bind is an attribute, it makes bindings invisible to the user while the page is loading.
Back
ng-dblclick
Front
Specifies a behavior on double-click events.
Back
What is dependency injection? How to use it?
Front
We use dependency injection to create and send services to the classes that need them. @Injectable()
We give our dependency injector providers so that it knows what classes it can create and send for us.
We ask for dependencies by specifying them in our class constructor.
Back
What is ngOnInit function?
Front
ngOnInit is invoked after the component is constructed and is the best place to initialize property values. Easier to test.
Back
Why is good to build a model for our up? How to build a model in TypeScript?
Front
TypeScript helps to be more object oriented with our data, can use classes to model our data.
Can specify class property types. This will allow our compiler to check our code and ensure we're getting and setting things properly.
If we use the wrong property names compiler would throw an error.
- Create a new file
- Create a JS class with export(so it can be imported)
- Add your data properties and declare a type for each
- Import your model to your component file
- Use your model Class name with []: Tells the type Script to treat this like an array of CarParts.
* Good practice to keep mock data separate from your model and your components, in it's own file.
Back
What are the 3 different kinds of directives?
Front
Directive: how we add dynamic behavior to HTML
- Component directive: has a template
- Structural directive: Alters layout by adding, removing or replacing HTML elements. ngFor, ngIf
- Attribute directive
Back
ng-change
Front
Specifies an expression to evaluate when content is being changed by the user.
Back
ng-list
Front
Converts text into a list (array).
Back
Section 2
(50 cards)
ng-non-bindable
Front
Specifies that no data binding can happen in this element, or its children.
Back
select
Front
AngularJS modifies the <select> element's default behaviors.
Back
ng-show
Front
Shows or hides HTML elements.
Back
$error
Front
Back
a
Front
AngularJS modifies the <a> element's default behaviors.
Back
ng-selected
Front
Specifies the selected attribute of an element.
Back
limitTo
Front
Limits an array, or a string, into a specified number of elements/characters.
Back
ng-model
Front
Binds the value of HTML controls to application data.
Back
ng-readonly
Front
Specifies the readonly attribute of an element.
Back
ng-mousemove
Front
Specifies a behavior on mousemove events.
Back
ng-repeat
Front
Defines a template for each data in a collection.
Back
ng-srcset
Front
Specifies the srcset attribute for the <img> element.
Back
ng-paste
Front
Specifies a behavior on paste events.
Back
$invalid
Front
Back
currency
Front
Format a number to a currency format.
Back
ng-src
Front
Specifies the src attribute for the <img> element.
Back
script
Front
AngularJS modifies the <script> element's default behaviors.
Back
angular.isArray()
Front
Returns true if the reference is an array
Back
ng-minlength
Front
Specifies the minimum number of characters allowed in the input field.
Back
input
Front
AngularJS modifies the <input> element's default behaviors.
Back
angular.lowercase()
Front
Converts a string to lowercase
Back
ng-transclude
Front
Specifies a point to insert transcluded elements.
Back
angular.uppercase()
Front
Converts a string to uppercase
Back
$dirty
Front
Back
ng-maxlength
Front
Specifies the maximum number of characters allowed in the input field.
Back
angular.forEach()
Front
Executes a function for each element in an object or array
Back
date
Front
Format a date to a specified format.
Back
ng-mouseup
Front
Specifies a behavior on mouseup events.
Back
ng-open
Front
Specifies the open attribute of an element.
Back
angular.copy()
Front
Creates a deep copy of an object or an array
Back
ng-options
Front
Specifies <options> in a <select> list.
Back
ng-model-options
Front
Specifies how updates in the model are done.
Back
uppercase
Front
Format a string to upper case.
Back
filter
Front
Select a subset of items from an array.
Back
ng-mousedown
Front
Specifies a behavior on mousedown events.
Back
ng-mouseenter
Front
Specifies a behavior on mouseenter events.
Back
number
Front
Format a number to a string.
Back
form
Front
AngularJS modifies the <form> element's default behaviors.
Back
lowercase
Front
Format a string to lower case.
Back
ng-switch
Front
Specifies a condition that will be used to show/hide child elements.
Back
ng-style
Front
Specifies the style attribute for an element.
Back
orderBy
Front
Orders an array by an expression.
Back
ng-submit
Front
Specifies expressions to run on onsubmit events.
Back
json
Front
Format an object to a JSON string.
Back
ng-mouseover
Front
Specifies a behavior on mouseover events.
Back
textarea
Front
AngularJS modifies the <textarea> element's default behaviors.
Back
ng-value
Front
Specifies the value of an input element.
Back
ng-pluralize
Front
Specifies a message to display according to en-us localization rules.
Back
ng-required
Front
Specifies the required attribute of an element.
Back
ng-mouseleave
Front
Specifies a behavior on mouseleave events.
Back
Section 3
(50 cards)
The $scope object is the _____ model in Angular
Front
data
Back
angular.isNumber()
Front
Returns true if the reference is a number
Back
angular.bootstrap()
Front
Starts AngularJS manually
Back
_____ are the properties of a scope
Front
Models
Back
It is ideal to contain the logic in a _____ and the data on the _____ of the controller
Front
1) controller
2) scope
Back
The '.module("appName")' method is also called the _____ method for the Angular module since it is how we reference a module
Front
getter
Back
_____ are attributes or elements that augment a DOM element into a reusable DOM component
Front
Directives
Back
$sanitize
Front
service that parses the html into tokens and removes potentially dangerous ones ()
Back
Scopes provide the ability to _____ for model changes
Front
watch
Back
angular.isUndefined()
Front
Returns true if the reference is undefined
Back
The scopes of the application refer to the application _____.
Front
model
Back
_____s are attached to the DOM where _____ properties are accessed through bindings
Front
Scope
Back
What is the event loop called?
Front
$digest() loop
Back
angular.isFunction()
Front
Returns true if the reference is a function
Back
angular.toJSON()
Front
Serializes a JSON string
Back
The _____ object is the closest object to the global context in an Angular app and is considered to be the parent of all $scope objects
Front
$rootScope
Back
angular.isDefined()
Front
Returns true if the reference is defined
Back
The '.module("appName", [])' method is also called the _____ method for the Angular module since it is how we define a module
Front
setter
Back
What Angular object interacts with the controller and whose properties are available to the view?
Front
The model object: $scope
Back
angular.isDate()
Front
Returns true if the reference is a date
Back
_____ format functions available in the view
Front
Filters
Back
When a value has changed since the last time the event loop ran, the value is considered to be _____.
Front
Dirty
Back
What symbol is used to denote internals and other built-in library functions in Angular?
Front
$ (dollar sign)
Back
_____ _____ are what binds expressions to the view in the form of {{ }}
Front
Value bindings
Back
angular.equals()
Front
Returns true if two references are equal
Back
List in order of execution:
A) View template links to scope
B) App renders the view
C) App sets up DOM to notify Angular of property changes
Front
A > C > B
Back
Describe what "$timeout" does
Front
It is an Angular service that is a function with two arguments: 1) A function to be called and 2) Amount of milliseconds to wait before calling the function (Argument 1) again
Back
What are the arguments of the "controller()" method?
Front
1) String: name of the controller (Required)
2) Function: logic of the controller (Required)
Back
The second argument of '.module()' is an array of strings listing modules that the _____ loads _____ the module itself is loaded
Front
1) injector
2) before
Back
The template (HTML w/data bindings) is rendered into the _____.
Front
View
Back
The $scope object is a connection between the _____ and the _____ and the glue between the _____ and the _____
Front
1) view
2) HTML
3) view
4) controller
Back
All _____ found on the $scope object are automatically accessible to the view
Front
properties
Back
The _____ presents data to the user. The _____ consists of application data and functions that interact with that data. The _____ mediates between the two.
Front
1) View
2) Model
3) Controller
(MVC framework)
Back
angular.isString()
Front
Returns true if the reference is a string
Back
_____ _____ validate user input
Front
Form controls
Back
angular.fromJSON()
Front
Deserializes a JSON string
Back
What are two things we need to nest an Angular app inside of a web app?
Front
1) angular.js file
2) Set ng-app attribute/directive on an element in the DOM
Back
angular.isElement()
Front
Returns true if the reference is a DOM element
Back
In the context of data binding, it is considered a best-practice in Angular to bind references in the _____ by a(n) _____ on an object, rather than the raw object itself
Front
1) views
2) attribute
Back
What are four reasons why we use scope?
Front
1) Watch for model changes
2) Propagate model changes through the app and other components
3) Nested for isolated functionality and model properties
4) Provide an environment to evaluate expressions
Back
What are the arguments of the "module()" method?
Front
1) String: name of the module (Required)
2) Array: if specified, will create a new module. If not specified, will look for the named module (Optional)
3) Function: logic for module configuration (Optional)
Back
angular.element()
Front
Wraps an HTML element as an jQuery element
Back
What are four advantages to using modules?
Front
1) Keeps the global scope clean
2) Makes tests cleaner and easier to write
3) Easier to share code between applications
4) Can load different portions of code at any time
Back
Which directive specifies a _____ class that injects functions and values into the scope of a DOM element?
Front
ng-controller
"Controller"
Back
Describe what it means for something to be "Bi-directional" in Angular
Front
Bi-directional means that if the view changes the value, the model observes the change through dirty checking, and if the model changes the value, the view updates with the change
Back
angular.isObject()
Front
Returns true if the reference is an object
Back
Which directive binds an input, select, textarea, or custom form control to a property on the scope using NgModelController? (Binds the view to the model)
Front
ng-model
Back
angular.module()
Front
Creates, registers, or retrieves an AngularJS module
Back
The process of checking for values that have changed since the last event loop is called _____.
Front
Dirty checking
Back
The _____ object is where we define the business functionality of the application, the methods in our controllers, and properties in the views
Front
$scope
Back
Section 4
(50 cards)
What is ng-app and how does Angular bootstrap?
Front
Back
What is the difference between `angular.module("app", [])` and `angular.module("app")`?
Front
Back
Explain what is services in Angular.js ?
Front
In angular.js services are the singleton objects or functions that are used for carrying out specific tasks.
Often related to business logic.
Back
ng-repeat
Front
Repeats for every entity in the controller's loop
Back
controller
Front
A Javascript object that controls the data and, I guess, the app itself
Back
Explain what are directives ? Mention some of the most commonly used directives in Angular.js application ?
Front
directive is something that introduces new syntax, they are like markers on DOM element which attaches a special behavior.
Back
dependencies
Front
Split up modules according to functionality
Back
If Angular cannot find a property within the local scope, it will go up a scope until it reaches the $rootScope. What happens if the property is not found in the $rootScope?
Front
It moves on and will not update the view
Back
ng-hide
Front
Hides the element if true
Back
When would you use $q.all()?
Front
Back
directives best practices
Front
Use element directives for UI widgets
Use attribute directives for mixin behaviors (stuff that affects behavior of HTML elements) such as a tooltip
Back
directive
Front
Basically an HTML attribute that controls the functionality of the HTML element
Back
custom directive
Front
Custom HTML tags basically, but can do many more things
Back
How would you filter a list via ng-repeat?
Front
Back
Where would you make your network calls (Network calls = $http):
1) controller
2) template
3) directive
4) or service
Why?
When would you use:
1) factory
2) provider
3) service
4) value
5) constant
Front
Back
Explain what are the key features of Angular.js ?
Front
- Two way data binding
- Scope
- MVC
Back
How would you inject services and what are the different ways to do so?
Front
Back
filter
Front
Does something to the input (data is usually piped into the filter), e.g. {{ data | filter:options }}
Back
What are promises and how would you use them?
Front
Back
Explain what is scope in Angular.js ?
Front
Scope refers to the application model, it acts like glue between application controller and the view.
It can watch expressions and propagate events.
Back
filter - limitTo
Front
Exactly what you think it does.
Back
What phases are there in Angular?
Front
Config --> Bootstrap --> Run
Back
ng-app
Front
Specifies what Angular app the HTML contained within will function under
Back
How do you ensure Angular uses jQuery when using both?
Front
Back
A scope created inside of a directive is called the _____ scope
Front
isolate
Back
$ - sign
Front
Indicates something is a built-in in Angular
Back
What is the difference between ng-if and ng-show?
Front
Back
What is 2 way binding?
Front
Back
What is dependency injection?
Front
Back
What is MVVM architecture?
Front
Back
What are filters?
Front
Back
ng-include
Front
Used for including HTML templates (these incur an AJAX request after the initial page loads)
Back
Why would you use ng-submit instead of ng-click?
Front
Back
What is ng-repeat?
Front
Back
What's jqLite?
Front
Back
Why would you use:
1) ng-src
2) ng-bind
3) ng-cloak
Front
Back
What is the difference between:
1) factory
2) provider
3) service
4) value
5) constant
Front
Back
Explain what is Angular Expression? Explain what is key difference between angular expressions and JavaScript expressions?
Front
Like JavaScript, Angular expressions are code snippets that are usually placed in binding such as {{ expression }}
The context is the scope object.
Back
name-changing
Front
<product-title> tag in HTML will translate into productTitle in app.direct(...)
Back
dependency injection
Front
Injecting the services that a controller needs as arguments to the controller function
Back
What is $http?
Front
Back
ng-src
Front
Use this to specify the source of the image.
Back
2-way data binding
Front
Expressions re-evaluated when property changes
Back
filter - orderBy
Front
Takes in an attribute of the entity and whether ascending or descending
Back
The _____ and _____ directives create their own child scopes and attach them to the DOM element
Front
1) ng-controller
2) ng-repeat
Back
Why would you use:
1) .config() phase
2) .run() phase
Front
Back
Section 5
(15 cards)
Mention the steps for the compilation process of HTML happens?
Front
Compilation of HTML process occurs in following ways
- Using the standard browser API, first the HTML is parsed into DOM
- By using the call to the $compile () method, compilation of the DOM is performed. The method traverses the DOM and matches the directives.
- Link the template with scope by calling the linking function returned from the previous step
Back
Explain what is DI (Dependency Injection ) and how an object or function can get a hold of its dependencies ?
Front
DI or Dependency Injection is a software design pattern that deals with how code gets hold of its dependencies. In order to retrieve elements of the application which is required to be configured when module gets loaded , the operation "config" uses dependency injection.
These are the ways that object uses to hold of its dependencies
Typically using the new operator, dependency can be created
By referring to a global variable, dependency can be looked up
Dependency can be passed into where it is required
Back
Explain what is injector?
Front
An injector is a service locator. It is used to retrieve object instances as defined by provider, instantiate types, invoke methods and load modules. There is a single injector per Angular application, it helps to look up an object instance by its name.
Back
Explain what Angular JS routes does ?
Front
Url mapping to a view or state.
Back
Mention what are the advantages of using Angular.js framework ?
Front
Advantages of using Angular.js as framework are
Supports two way data-binding
Supports MVC pattern
Support static template and angular template
Can add custom directive
Supports REST full services
Supports form validations
Support both client and server communication
Support dependency injection
Applying Animations
Event Handlers
Back
Explain what is directive and Mention what are the different types of Directive?
Front
During compilation process when specific HTML constructs are encountered a behaviour or function is triggered, this function is referred as directive. It is executed when the compiler encounters it in the DOM.
Different types of directives are
- Element directives
- Attribute directives
- CSS class directives
- Comment directives
Back
Explain what is linking function and type of linking function?
Front
Link combines the directives with a scope and produce a live view. For registering DOM listeners as well as updating the DOM, link function is responsible. After the template is cloned it is executed.
- Pre-linking function: Pre-linking function is executed before the child elements are linked. It is not considered as the safe way for DOM transformation.
- Post linking function: Post linking function is executed after the child elements are linked. It is safe to do DOM transformation by post-linking function
Back
Explain what is the difference between angular.js and backbone.js?
Front
Angular.js combines the functionalities of most of the 3rd party libraries, it supports individual functionalities required to develop HTML5 Apps. While Backbone.js do their jobs individually.
Back
Explain what is string interpolation in angular.js ?
Front
The compiler during the compilation process matches text and attributes using interpolate service to see if they contains embedded expressions. As part of normal digest cycle these expressions are updated and registered as watches.
Back
Explain what is factory method in angular.js?
Front
For creating the directive, factory method is used. It is invoked only once, when compiler matches the directive for the first time. By using $injector.invoke the factory method is invoked.
Back
Mention what are the characteristics of "Scope"?
Front
- To observer model mutations scopes provide APIs ($watch)
- To propagate any model changes through the system into the view from outside of the Angular realm
- A scope inherits properties from its parent scope, while providing access to shared model properties, scopes can be nested to isolate application components
- Scope provides context against which expressions are evaluated
Back
Explain the concept of scope hierarchy? How many scope can an application have?
Front
Each angular application consist of one root scope but may have several child scopes. As child controllers and some directives create new child scopes, application can have multiple scopes. When new scopes are formed or created they are added as a children of their parent scope. Similar to DOM, they also creates a hierarchical structure.
Back
What makes angular.js better ?
Front
- Two way data binding
- Transfer data to and from the UI
- No init code
Back
Explain what is the difference between link and compile in angular.js?
Front
- Compile function: It is used for template DOM Manipulation and collect all of the directives.
- Link function: It is used for registering DOM listeners as well as instance DOM manipulation. It is executed once the template has been cloned.
Back
Explain what is data binding in Angular.js ?
Front
Automatic synchronization of data between the model and view components