Day 25: Review
Tuesday, July 5, 2016
Topics
JavaScript
- Hoisting - Function and variable declarations are always hoisted to the top of their containing scope by the JavaScript interpreter. Variable assignments are not hoisted.
- Function Declarations vs Function Expressions - A quick overview of hoisting with examples
- Scoping and Hoisting - A more in-depth look at scoping and hoisting
So this:
function foo() {
bar();
var x = 1;
}
Is interpreted as:
function foo() {
var x;
bar();
x = 1;
}
AngularJS
controllerAs
resolve
- Factories
- Custom Directives
- Default use is as attribute or element (as of Angular 1.3)
bindToController
- binds isolate scope properties to controller for use with controllerAs
syntax
- Style
- Function declarations over function expressions
activate()
functions for resolving start-up logic for a controller
- Bindable / Accessible members up top
Homework
Continue working on refactor of Meganote. If you need to start from a fresh copy, the repo in its current state can be cloned here