Intro to Angular
Zach Barnes
Summary
How it works
Data binding
Scope
Controllers
Services
Modules
Routing
Components
How it works
How it works
Browser builds DOM
Angular bootstraps
Changes to model trigger updates to DOM
Changes to DOM trigger updates to model
Data binding
Data binding
How the model gets updated
How the UI gets updated
Two types
One-way
Two-way
Data binding: One way
E.g. Angular 2, React
Source of truth, our model, somewhere in code
UI cannot update model
UI triggers events -> events trigger changes to model -> model changes update
the UI
Data binding: two-way
E.g. Angular 1
Changes in UI update the model
Changes to model update the UI
Scope
Scope
Angular’s source of truth
Can consider $scope to be the page
Changes to the scope update the page
Anything on the scope is tracked
Anything not on the scope isn’t tracked
Controllers
Controllers
Control the page
Anything that directly affects the UI goes here
Services
Services
Singleton
Handles anything not directly related to UI
Modules
Modules
Configuration for a section of a page
Routing goes here
Provider configuration goes here
Anything that needs to happen before the page loads goes here
Routing
Routing
States
Views
controllers
Components
Components
A new way for connecting routes, templates, and controllers
Creates a DOM element you can use anywhere

Intro to angular