What is AngularJS?
structured, easily testable, and maintainable front-end
History & Future
• Originally created in 2010 by Misko Hevery and Adam
Abrons, now run by the Google team.
• Everything should be a component - see Angular v2.0
Two Parts to Angular
1. UI - Declarative - What happens in the HTML.
What do you mean, "what happens in the HTML"? Isn't this a
Why use AngularJS?
• Works well with other libraries (but requires none of them)
• Ability to create extremely fast websites
• It is easy to write tests for - because of modules
Um... so is AngularJS an MVC?
The model is made up of plain JS objects. No need for
inheriting or extending. We also don't need to use any special
getter/setter methods to access it. This means that we write
less boilerplate code.
It is an object that provides speciﬁc data and methods to a
speciﬁc view. $scope is just a regular JS object with a small API
created to detect changes to its state.
The controller is used for setting initial state and mutating the
$scope with methods.
The view is the HTML that exists after AngularJS has parsed
and compiled the HTML to included rendered markup and
A method that instantiates and wires together the different parts
of the application.
• This is our "Imperative" part
• The $scope is a reference to your data. The controller
deﬁnes the behavior and the view handles the layout.
• This is our "Declaritive" part
• A directive is a marker on a HTML tag that tells AngularJS to
run or reference some JS code.
TWO-WAY DATA BINDING
... yeah, but is two-way data binding good?