Skip to content

Latest commit

 

History

History
50 lines (45 loc) · 2.66 KB

angular.md

File metadata and controls

50 lines (45 loc) · 2.66 KB
layout title permalink feature-img hide
page
Angular Notes
/angular/
img/feature_img_4.png
true

Angular is a JavaScript framework for building dynamic web applications.

  • CRUD (Create, Read, Update, Delete)
  • not suitable for static, content-heavy sites
  • SPA: single-page applications
    • do not require page loads when navigating between pages, like with most websites
    • goal is a UX similar to desktop applications
    • e.g. Gmail, Medium, Virgin America
  • extend HTML syntax with directives
    • directives attach particular behavior(s) to DOM elements
    • Example: <div ng-click="doSomething()">
  • two-way data binding: automatic synchronization of data between model and view components

Framework vs Library

  • Framework: provides basic structure of application; developer's code fills in details
  • Library: a collection of prewritten code of common tasks to simplify development; developer's code provides structure for which the library provides details

Architectural Patterns

  • MVC (Model-View-Controller)
    • Models - represent knowledge (HTML)
    • Views - visual representations of models (CSS)
    • Controllers - links between users and systems (browsers)
  • MVVM (Model-View-ViewModel)
    • ViewModel represents the View and exposes data objects from the Model
    • ViewModel provides data binding between View and Model
    • Angular started MVC but is becoming more MVVM

Modules

  • Modules are containers for different parts of a web app
    • Controllers
    • Services
    • Filters
    • Directives
  • Encapsulation: create functions locally within modules to avoid shadowing in the global scope Linters: tools that check code quality (e.g. JSHint)

Resources