KEMBAR78
Why try angularJS? | PPTX
$scope.presentation = {
author: 'Jerguš Lejko',
year: 2015
};
What is AngularJS?
• MAGIC
• JS frontend MVC framework
• SPA
• routing (history-back, url change)
• api calls
• view loading
• really cool thing
• "HTML extension"
• full-package solution
Miško
Hevery
• <ng-creator
ng-init="year = 2009" />
• code tester
• Adobe, Sun Microsystems,
Intel, Xerox
Why use AngularJS?
• MVC done RIGHT
• perfect match to REST API
• Two-Way Data Binding
• Dependency Injection
• Directives
• works out-of-box
• NO DIRTY DOM MANIPULATION
One-way Data Binding
Two-way Data Binding
Dependency Injection
• angular takes care of DI
• injects what needed, where needed
app.controller('MyFirstController', function(dep1, dep2)
{
// some really smart stuff
});
app.controller('MyFirstController', ['dep1', 'dep2', function(dep1, dep2)
{
// some really smart stuff
}]);
$scope
• data-model
• created by some directives (ng-controller, ng-repeat)
• similar to traditional JS scope
• also referred to as 'controller'
• inherits from it’s parent
• $rootScope
{{ expression }}
• complied by angular’s compiler on view-load
• expression - variables from current scope (or from
parent scope), not global js variables
• filters applicable - {{ expression | filter1 | filter2 }}
• has "flash effect" - avoid by using:
<div ng-bind="expression"></div>
{{ 'hello' | uppercase }} => HELLO
{{ 'hello' | limitTo:4 }} => hell
{{ 1288323623006 | date:"MM/dd/yyyy 'at' h:mma" }}: 10/29/2010 at 5:40AM
• filter:argument1:argument2:argumentN
• modifies the expression and returns a modified value
• apply as much filters as you want
{{ expression | filter }}
<directives>
• custom HTML elements
• "extension of HTML"
• represented by: element, attribute or css class
• attach special behaviour to a DOM element
• ex.: ng-model, ng-bind, ng-click…
How to start?
angularjs.org
angular.codeschool.com
tutorialspoint.com/angularjs
thinkster.io/a-better-way-to-learn-angularjs
Good luck!

Why try angularJS?