SlideShare a Scribd company logo
AngularJs-training
Module
Module
<html ng-app=”myApp” >
Config Filter Directive Factory Controller
Routes
Service
Value
Provider
Data Binding
Expression Syntax
Two way binding
<p>Hello {{name}}!</p>
One way binding
<p>Hello {{::name}}!</p>
Controller declare
/* recommended */
// dashboard.js
angular
.module('app')
.controller('DashboardController', DashboardController);
function DashboardController() { }
/* avoid */
angular
.module('app')
.controller('DashboardController', function() { })
controllerAs View Syntax
<!-- avoid -->
<div ng-controller="DashboardController">
{{ name }}
</div>
<!-- recommended -->
<div ng-controller="DashboardController as dashboard">
{{ dashboard.name }}
</div>
controllerAs Controller Syntax
/* avoid */
function DashboardController() {
this.name = {};
this.sendMessage = function() { };
}
/* recommended */
function DashboardController() {
var vm = this;
vm.name = {};
vm.sendMessage = function() { };
}
Why use controllerAs syntax
// avoid
<div ng-controller="parentContrl">
{{ title }}
<div ng-controller="ChildContrl">
{{ title }}
{{ $parent.title }}
</div>
</div>
app.controller('parentContrl', function () {
this.title = 'Some title';
});
app.controller('ChildContrl', function () {
this.title = 'Some title';
});
// recommend
<div ng-controller="parentContrl as parent">
{{ parent.title }}
<div ng-controller="ChildContrl as child">
{{ child.title }}
{{ parent.title }}
</div>
</div>
Working with Form
Form validation with HTML5
Form validation with Core Angular
Form validation with angular-auto-validate
source: https://github.com/jonsamwell/angular-auto-validate
Document: http://jonsamwell.github.io/angular-auto-validate/
Form animation
source: https://github.com/sachinchoolur/ladda-angular
Simple: http://sachinchoolur.github.io/ladda-angular/
Submit form with $http
Document: https://docs.angularjs.org/api/ng/service/$http
$http({
method: 'GET',
url: '/someUrl'
}).then(function successCallback(response) {
// this callback will be called asynchronously
// when the response is available
}, function errorCallback(response) {
// called asynchronously if an error occurs
// or server returns response with an error status.
});
Event handle
ngClick
<ANY
ng-click="expression">
...
</ANY>
Work with JSON
[
{
"name":"Billy Williams",
"email":"bwilliams0@apple.com",
"job":"Actuary",
"skill":"PDF Creator",
"pic":"https://robohash.org/eanostrumincidunt.jpg?size=120x120u0026set=set1"
},
{
"name":"Steven Frazier",
"email":"sfrazier1@pinterest.com",
"job":"Design Engineer",
"skill":"NC-Verilog",
"pic":"https://robohash.org/repudiandaeomnisest.bmp?size=120x120u0026set=set1"
},
{
"name":"Doris Clark",
"email":"dclark2@uol.com.br",
"job":"Nurse Practicioner",
"skill":"Axis",
"pic":"https://robohash.org/providentvoluptateet.png?size=120x120u0026set=set1"
}
]
Show JSON with ngRepeat
<div ng-repeat="obj in myObj"> ... </div>
<ANY
ng-repeat="repeat_expression">
...
</ANY>
Example
Sorting
<div ng-repeat="obj in myObj | orderBy:sortType:sortReverse"> ... </div>
sortType: JSON field name
Params
sortReverse: ascending or descending
data
Filter
keyword: text for search
Params
<div ng-repeat="obj in myObj | filter:keyword"> ... </div>
Service
AngularJS world, the services are singleton objects or functions that carry out specific tasks. It holds
some business logic. Separation of concern is at the heart while designing an AngularJS application.
Your controller must be responsible for binding model data to views using $scope. It does not contain
logic to fetch the data or manipulating it.
There are 3 type of service factory, service, provider , you can use to communicate data between
controller also.
Factory
Factory Provider
Gives us the function's return value ie. You just create an object, add properties to it, then return that same
object.When you pass this service into your controller, those properties on the object will now be
available in that controller through your factory. (Hypothetical Scenario)
Singleton and will only be created once
Reusable components
Factory are a great way for communicating between controllers like sharing data.
Can use other dependencies
Usually used when the service instance requires complex creation logic
Cannot be injected in .config() function.
Used for non configurable services
If you're using an object, you could use the factory provider.
Service
Service Provider
Gives us the instance of a function (object)- You just instantiated with the ‘new’ keyword and you’ll add
properties to ‘this’ and the service will return ‘this’.When you pass the service into your controller,
those properties on ‘this’ will now be available on that controller through your service. (Hypothetical
Scenario)
Singleton and will only be created once
Reusable components
Services are used for communication between controllers to share data
You can add properties and functions to a service object by using the this keyword
Dependencies are injected as constructor arguments
Used for simple creation logic
Cannot be injected in .config() function.
If you're using a class you could use the service provider
Provider
Providers
● Syntax: module.provider( 'providerName', function );
Result: When declaring providerName as an injectable argument you will be provided with (new
ProviderFunction()).$get(). The constructor function is instantiated before the $get method is called -
ProviderFunction is the function reference passed to module.provider.
Providers have the advantage that they can be configured during the module configuration phase.
myApp.provider('helloWorld', function() {
// In the provider function, you cannot inject any
// service or factory. This can only be done at the
// "$get" method.
this.name = 'Default';
this.$get = function() {
var name = this.name;
return {
sayHello: function() {
return "Hello, " + name + "!"
}
}
};
this.setName = function(name) {
this.name = name;
};
});
//hey, we can configure a provider!
myApp.config(function(helloWorldProvider){ helloWorldProvider.setName('World'); });
Connect REST API with ngResource, $http
ngResource: https://docs.angularjs.org/api/ngResource
$http: https://docs.angularjs.org/api/ng/service/$http
function asyncGreet(name) {
var deferred = $q.defer();
setTimeout(function() {
deferred.notify('About to greet ' + name + '.');
if (okToGreet(name)) {
deferred.resolve('Hello, ' + name + '!');
} else {
deferred.reject('Greeting ' + name + ' is not allowed.');
}
}, 1000);
return deferred.promise;
}
var promise = asyncGreet('Robin Hood');
promise.then(function(greeting) {
alert('Success: ' + greeting);
}, function(reason) {
alert('Failed: ' + reason);
}, function(update) {
alert('Got notification: ' + update);
});
Directive
Directives are markers on a DOM element which attach a special behavior to it. For example, static HTML does not
know how to create and display a date picker widget. To teach HTML this new syntax we need a directive. The directive
will somehow create an element that behaves like a date picker. We will see how this is achieved subsequently.
syntax : app.directive('helloWorld', function() {...});
Directive
<!-- recommended -->
<my-calendar-range></my-calendar-range>
<div my-calendar-range></div>
/* recommended */
angular
.module('myApp)
.directive('helloWorld',helloWorld);
function helloWorld() {
var directive = {
link: link,
templateUrl: '/template/hello.html or <div> hello </div>',
restrict: 'EA'
};
return directive;
function link(scope, element, attrs) {
/* */
}
}
Directive isolate
● Share scope
● None isolate
● @ Local Scope Property
● = Local Scope Property
● & Local Scope Property
Share Scope
angular
.module('myApp')
.directive('sayHi',sayHi);
function sayHi() {
var directive = {
template: '<div> {{name}} </div>',
restrict: 'EA'
};
return directive;
}
angular
.module('myApp')
.controller('sayHi',hello);
function hello($scope) {
$scope.name = 'Hi';
}
Share scope
controller
$scope.name = 'Hi'
$scope.name = 'Hi'
directive
None isolate
angular
.module('myApp')
.directive('sayHi',sayHi);
function sayHi() {
var directive = {
scope: {},
template: '<div> {{name}} </div>',
restrict: 'EA'
};
return directive;
}
angular
.module('myApp')
.controller('sayHi',hello);
function hello($scope) {
$scope.name = 'Hi';
}
none isolate
controller
$scope.name = 'Hi'
$scope.name = 'Hi'
directive
@ Local Scope Property
angular
.module('myApp')
.directive('sayHi',sayHi);
function sayHi() {
var directive = {
scope: {name:'@'},
template: '<div> Hi {{name}} !!</div>',
restrict: 'EA'
};
return directive;
}
angular
.module('myApp')
.controller('sayHi',hello);
function hello($scope) {
$scope.name = 'Lisa';
}
@ scope
controller
<say-hi name={{name}}></say-hi>
Scope:{ name: '@' }
directive
Use to access string value
= Local Scope Property
angular
.module('myApp')
.directive('sayHi',sayHi);
function sayHi() {
var directive = {
scope: { people:'='},
template: '<div> Hi {{peopel.name}} !!</div>',
restrict: 'EA'
};
return directive;
}
angular
.module('myApp')
.controller('sayHi',hello);
function hello($scope) {
$scope.lisa = {
name.'Lisa';
age : 29
};
}
= scope two way binding
controller
<say-hi people=”lisa”></say-hi>
scope:{ people: '=' }
directive
Use to bind object
& Local Scope Property
angular
.module('myApp')
.directive('sayHi',sayHi);
function sayHi() {
var directive = {
scope: { people:'='},
template: '<ul><li ng-repeat="name in people">{{name}}</li></ul><button
ng-click="action()">swap</button>',
restrict: 'EA'
};
return directive;
}
angular
.module('myApp')
.controller('sayHi',hello);
function hello($scope) {
$scope.people = ['Lisa', 'John', 'Tom'];
$scope.swap = function() {
var j, x, i;
for (i = $scope.people.length; i; i -= 1) {
j = Math.floor(Math.random() * i);
x = $scope.people[i - 1];
$scope.people[i - 1] = $scope.people[j];
$scope.people[j] = x;
}
}
}
@ scope two way binding
controller
<say-hi people="people"
action="swap()"></say-hi>
scope:{ action: '&' }
directive
Use to call external function
Directive link function
angular
.module('myApp)
.directive('helloWorld',helloWorld);
function helloWorld() {
var directive = {
link: link,
templateUrl: '<div>{{name}}</div>',
restrict: 'EA'
};
return directive;
function link(scope, element, attrs) {
Scope.num = 2;
}
}
Routing app with uiRouter
Source & Document: https://github.com/angular-ui/ui-router
myApp.config(function($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise("/");
$stateProvider
.state('state1', {
url: "/state1",
templateUrl: "partials/state1.html"
})
.state('state2', {
url: "/state2",
templateUrl: "partials/state2.html"
});
});
Advance in Angular
Event in system $emit, $broadcast and $on via
$scope and $rootScope
Promise with $q and build-in $http
$q is a service that helps you run functions asynchronously, and use their return values (or
exceptions) when they are done processing.
This is an implementation of promises/deferred objects inspired by Kris Kowal's Q.
$q can be used in two fashions --- one which is more similar to Kris Kowal's Q or jQuery's Deferred implementations,
and the other which resembles ES6 (ES2015) promises to some degree.
Promise stop hell-callback
fn1(function() {
fn2(function() {
fn3(function() {
fn4(function() {
// your process
});
});
});
});
Deep dive a Scope
● Root Scope
● Child Scope
● Dot notation
Ad

More Related Content

What's hot (20)

Catalyst patterns-yapc-eu-2016
Catalyst patterns-yapc-eu-2016Catalyst patterns-yapc-eu-2016
Catalyst patterns-yapc-eu-2016
John Napiorkowski
 
Workshop 19: ReactJS Introduction
Workshop 19: ReactJS IntroductionWorkshop 19: ReactJS Introduction
Workshop 19: ReactJS Introduction
Visual Engineering
 
Workshop 13: AngularJS Parte II
Workshop 13: AngularJS Parte IIWorkshop 13: AngularJS Parte II
Workshop 13: AngularJS Parte II
Visual Engineering
 
AngularJS - Services
AngularJS - ServicesAngularJS - Services
AngularJS - Services
Nir Kaufman
 
AngularJS.part1
AngularJS.part1AngularJS.part1
AngularJS.part1
Andrey Kolodnitsky
 
ChtiJUG - Introduction à Angular2
ChtiJUG - Introduction à Angular2ChtiJUG - Introduction à Angular2
ChtiJUG - Introduction à Angular2
Demey Emmanuel
 
Technozaure - Angular2
Technozaure - Angular2Technozaure - Angular2
Technozaure - Angular2
Demey Emmanuel
 
AngularJS Basic Training
AngularJS Basic TrainingAngularJS Basic Training
AngularJS Basic Training
Cornel Stefanache
 
Trustparency web doc spring 2.5 & hibernate
Trustparency web doc   spring 2.5 & hibernateTrustparency web doc   spring 2.5 & hibernate
Trustparency web doc spring 2.5 & hibernate
trustparency
 
AngularJS Internal
AngularJS InternalAngularJS Internal
AngularJS Internal
Eyal Vardi
 
Angular presentation
Angular presentationAngular presentation
Angular presentation
Matus Szabo
 
JSLab. Алексей Волков. "React на практике"
JSLab. Алексей Волков. "React на практике"JSLab. Алексей Волков. "React на практике"
JSLab. Алексей Волков. "React на практике"
GeeksLab Odessa
 
AngularJs $provide API internals & circular dependency problem.
AngularJs $provide API internals & circular dependency problem.AngularJs $provide API internals & circular dependency problem.
AngularJs $provide API internals & circular dependency problem.
Yan Yankowski
 
Angular2 & ngrx/store: Game of States
Angular2 & ngrx/store: Game of StatesAngular2 & ngrx/store: Game of States
Angular2 & ngrx/store: Game of States
Oren Farhi
 
Using the Features API
Using the Features APIUsing the Features API
Using the Features API
cgmonroe
 
Upgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.xUpgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.x
Eyal Vardi
 
Extend sdk
Extend sdkExtend sdk
Extend sdk
Harsha Nagaraj
 
Developing New Widgets for your Views in Owl
Developing New Widgets for your Views in OwlDeveloping New Widgets for your Views in Owl
Developing New Widgets for your Views in Owl
Odoo
 
IndexedDB - Querying and Performance
IndexedDB - Querying and PerformanceIndexedDB - Querying and Performance
IndexedDB - Querying and Performance
Parashuram N
 
Angular 2.0 Routing and Navigation
Angular 2.0 Routing and NavigationAngular 2.0 Routing and Navigation
Angular 2.0 Routing and Navigation
Eyal Vardi
 
Catalyst patterns-yapc-eu-2016
Catalyst patterns-yapc-eu-2016Catalyst patterns-yapc-eu-2016
Catalyst patterns-yapc-eu-2016
John Napiorkowski
 
Workshop 19: ReactJS Introduction
Workshop 19: ReactJS IntroductionWorkshop 19: ReactJS Introduction
Workshop 19: ReactJS Introduction
Visual Engineering
 
Workshop 13: AngularJS Parte II
Workshop 13: AngularJS Parte IIWorkshop 13: AngularJS Parte II
Workshop 13: AngularJS Parte II
Visual Engineering
 
AngularJS - Services
AngularJS - ServicesAngularJS - Services
AngularJS - Services
Nir Kaufman
 
ChtiJUG - Introduction à Angular2
ChtiJUG - Introduction à Angular2ChtiJUG - Introduction à Angular2
ChtiJUG - Introduction à Angular2
Demey Emmanuel
 
Technozaure - Angular2
Technozaure - Angular2Technozaure - Angular2
Technozaure - Angular2
Demey Emmanuel
 
Trustparency web doc spring 2.5 & hibernate
Trustparency web doc   spring 2.5 & hibernateTrustparency web doc   spring 2.5 & hibernate
Trustparency web doc spring 2.5 & hibernate
trustparency
 
AngularJS Internal
AngularJS InternalAngularJS Internal
AngularJS Internal
Eyal Vardi
 
Angular presentation
Angular presentationAngular presentation
Angular presentation
Matus Szabo
 
JSLab. Алексей Волков. "React на практике"
JSLab. Алексей Волков. "React на практике"JSLab. Алексей Волков. "React на практике"
JSLab. Алексей Волков. "React на практике"
GeeksLab Odessa
 
AngularJs $provide API internals & circular dependency problem.
AngularJs $provide API internals & circular dependency problem.AngularJs $provide API internals & circular dependency problem.
AngularJs $provide API internals & circular dependency problem.
Yan Yankowski
 
Angular2 & ngrx/store: Game of States
Angular2 & ngrx/store: Game of StatesAngular2 & ngrx/store: Game of States
Angular2 & ngrx/store: Game of States
Oren Farhi
 
Using the Features API
Using the Features APIUsing the Features API
Using the Features API
cgmonroe
 
Upgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.xUpgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.x
Eyal Vardi
 
Developing New Widgets for your Views in Owl
Developing New Widgets for your Views in OwlDeveloping New Widgets for your Views in Owl
Developing New Widgets for your Views in Owl
Odoo
 
IndexedDB - Querying and Performance
IndexedDB - Querying and PerformanceIndexedDB - Querying and Performance
IndexedDB - Querying and Performance
Parashuram N
 
Angular 2.0 Routing and Navigation
Angular 2.0 Routing and NavigationAngular 2.0 Routing and Navigation
Angular 2.0 Routing and Navigation
Eyal Vardi
 

Viewers also liked (20)

2015 AYME MOOC PAPER
2015 AYME MOOC PAPER2015 AYME MOOC PAPER
2015 AYME MOOC PAPER
Charlotte McCorquodale
 
6 กลเม็ดการติดต่อสื่อสาร 6 powerful communication tips
6 กลเม็ดการติดต่อสื่อสาร 6 powerful communication tips 6 กลเม็ดการติดต่อสื่อสาร 6 powerful communication tips
6 กลเม็ดการติดต่อสื่อสาร 6 powerful communication tips
maruay songtanin
 
(Hindi) Zuljanah - By: Syed ul Ulama Syed Ali Naqi Naqvi Sahab t.s.
(Hindi) Zuljanah - By: Syed ul Ulama Syed Ali Naqi Naqvi Sahab t.s.(Hindi) Zuljanah - By: Syed ul Ulama Syed Ali Naqi Naqvi Sahab t.s.
(Hindi) Zuljanah - By: Syed ul Ulama Syed Ali Naqi Naqvi Sahab t.s.
Jamal Mirza
 
Sanntidsdata i ArcGIS - Esri norsk BK 2014
Sanntidsdata i ArcGIS -  Esri norsk BK 2014Sanntidsdata i ArcGIS -  Esri norsk BK 2014
Sanntidsdata i ArcGIS - Esri norsk BK 2014
Geodata AS
 
Ilio Krumins Beens and Maureen McMahon: Kaplan Transition to Agile
Ilio Krumins Beens and Maureen McMahon: Kaplan Transition to AgileIlio Krumins Beens and Maureen McMahon: Kaplan Transition to Agile
Ilio Krumins Beens and Maureen McMahon: Kaplan Transition to Agile
bisg
 
IPMA - Cel PMO? - Samolikwidacja, The goal of the PMO? Self-Destruction
IPMA - Cel PMO? - Samolikwidacja, The goal of the PMO? Self-DestructionIPMA - Cel PMO? - Samolikwidacja, The goal of the PMO? Self-Destruction
IPMA - Cel PMO? - Samolikwidacja, The goal of the PMO? Self-Destruction
Michal Raczka
 
حدیثوں میں جس مسیح اور مہدی کا زکر ہے اس کا کیا ثبوت ہے کہ حضرت مرزا صاحب ہی ...
حدیثوں میں جس مسیح اور مہدی کا زکر ہے اس کا کیا ثبوت ہے کہ حضرت مرزا صاحب ہی ...حدیثوں میں جس مسیح اور مہدی کا زکر ہے اس کا کیا ثبوت ہے کہ حضرت مرزا صاحب ہی ...
حدیثوں میں جس مسیح اور مہدی کا زکر ہے اس کا کیا ثبوت ہے کہ حضرت مرزا صاحب ہی ...
muzaffertahir9
 
Karbala ke dukhit Hussain a.s. - Ayatullah Al Uzma Syed Ali Naqi Naqvi t.s.
Karbala ke dukhit Hussain a.s. - Ayatullah Al Uzma Syed Ali Naqi Naqvi t.s.Karbala ke dukhit Hussain a.s. - Ayatullah Al Uzma Syed Ali Naqi Naqvi t.s.
Karbala ke dukhit Hussain a.s. - Ayatullah Al Uzma Syed Ali Naqi Naqvi t.s.
Jamal Mirza
 
Mujahedaey Karbala - Part 01 - Syedul Ulema S. Ali Naqi Naqvi t.s.
Mujahedaey Karbala - Part 01 - Syedul Ulema S. Ali Naqi Naqvi t.s.Mujahedaey Karbala - Part 01 - Syedul Ulema S. Ali Naqi Naqvi t.s.
Mujahedaey Karbala - Part 01 - Syedul Ulema S. Ali Naqi Naqvi t.s.
Jamal Mirza
 
Santiago Fajardo Palacio de Longoria
Santiago Fajardo Palacio de LongoriaSantiago Fajardo Palacio de Longoria
Santiago Fajardo Palacio de Longoria
Santiago Fajardo
 
GSP East 2008 - Intro & Welcome
GSP East 2008 - Intro & WelcomeGSP East 2008 - Intro & Welcome
GSP East 2008 - Intro & Welcome
Dave McClure
 
Core10
Core10Core10
Core10
wattana072
 
LED pracovní světlo 18W 10-30V
LED pracovní světlo 18W 10-30VLED pracovní světlo 18W 10-30V
LED pracovní světlo 18W 10-30V
Roel Adriaan Ramp
 
Content marketing för e-handel - fördjupning
Content marketing för e-handel - fördjupningContent marketing för e-handel - fördjupning
Content marketing för e-handel - fördjupning
Christer Pettersson
 
Twitter, bloggar, Facebook och YouTube – var ska jag börja?
Twitter, bloggar, Facebook och YouTube – var ska jag börja?Twitter, bloggar, Facebook och YouTube – var ska jag börja?
Twitter, bloggar, Facebook och YouTube – var ska jag börja?
Please copy me
 
نظم نكت الانتصار
نظم نكت الانتصارنظم نكت الانتصار
نظم نكت الانتصار
حمادي نزار
 
Boost
BoostBoost
Boost
J.C. Young
 
Top 10 Rules for Vertical Revolutionaries
Top 10 Rules for Vertical RevolutionariesTop 10 Rules for Vertical Revolutionaries
Top 10 Rules for Vertical Revolutionaries
Dave McClure
 
8 Blogging Tools That You Need to Increase Traffic and Links
8 Blogging Tools That You Need to Increase Traffic and Links8 Blogging Tools That You Need to Increase Traffic and Links
8 Blogging Tools That You Need to Increase Traffic and Links
Venchito Tampon
 
Swu
SwuSwu
Swu
tontong1150
 
6 กลเม็ดการติดต่อสื่อสาร 6 powerful communication tips
6 กลเม็ดการติดต่อสื่อสาร 6 powerful communication tips 6 กลเม็ดการติดต่อสื่อสาร 6 powerful communication tips
6 กลเม็ดการติดต่อสื่อสาร 6 powerful communication tips
maruay songtanin
 
(Hindi) Zuljanah - By: Syed ul Ulama Syed Ali Naqi Naqvi Sahab t.s.
(Hindi) Zuljanah - By: Syed ul Ulama Syed Ali Naqi Naqvi Sahab t.s.(Hindi) Zuljanah - By: Syed ul Ulama Syed Ali Naqi Naqvi Sahab t.s.
(Hindi) Zuljanah - By: Syed ul Ulama Syed Ali Naqi Naqvi Sahab t.s.
Jamal Mirza
 
Sanntidsdata i ArcGIS - Esri norsk BK 2014
Sanntidsdata i ArcGIS -  Esri norsk BK 2014Sanntidsdata i ArcGIS -  Esri norsk BK 2014
Sanntidsdata i ArcGIS - Esri norsk BK 2014
Geodata AS
 
Ilio Krumins Beens and Maureen McMahon: Kaplan Transition to Agile
Ilio Krumins Beens and Maureen McMahon: Kaplan Transition to AgileIlio Krumins Beens and Maureen McMahon: Kaplan Transition to Agile
Ilio Krumins Beens and Maureen McMahon: Kaplan Transition to Agile
bisg
 
IPMA - Cel PMO? - Samolikwidacja, The goal of the PMO? Self-Destruction
IPMA - Cel PMO? - Samolikwidacja, The goal of the PMO? Self-DestructionIPMA - Cel PMO? - Samolikwidacja, The goal of the PMO? Self-Destruction
IPMA - Cel PMO? - Samolikwidacja, The goal of the PMO? Self-Destruction
Michal Raczka
 
حدیثوں میں جس مسیح اور مہدی کا زکر ہے اس کا کیا ثبوت ہے کہ حضرت مرزا صاحب ہی ...
حدیثوں میں جس مسیح اور مہدی کا زکر ہے اس کا کیا ثبوت ہے کہ حضرت مرزا صاحب ہی ...حدیثوں میں جس مسیح اور مہدی کا زکر ہے اس کا کیا ثبوت ہے کہ حضرت مرزا صاحب ہی ...
حدیثوں میں جس مسیح اور مہدی کا زکر ہے اس کا کیا ثبوت ہے کہ حضرت مرزا صاحب ہی ...
muzaffertahir9
 
Karbala ke dukhit Hussain a.s. - Ayatullah Al Uzma Syed Ali Naqi Naqvi t.s.
Karbala ke dukhit Hussain a.s. - Ayatullah Al Uzma Syed Ali Naqi Naqvi t.s.Karbala ke dukhit Hussain a.s. - Ayatullah Al Uzma Syed Ali Naqi Naqvi t.s.
Karbala ke dukhit Hussain a.s. - Ayatullah Al Uzma Syed Ali Naqi Naqvi t.s.
Jamal Mirza
 
Mujahedaey Karbala - Part 01 - Syedul Ulema S. Ali Naqi Naqvi t.s.
Mujahedaey Karbala - Part 01 - Syedul Ulema S. Ali Naqi Naqvi t.s.Mujahedaey Karbala - Part 01 - Syedul Ulema S. Ali Naqi Naqvi t.s.
Mujahedaey Karbala - Part 01 - Syedul Ulema S. Ali Naqi Naqvi t.s.
Jamal Mirza
 
Santiago Fajardo Palacio de Longoria
Santiago Fajardo Palacio de LongoriaSantiago Fajardo Palacio de Longoria
Santiago Fajardo Palacio de Longoria
Santiago Fajardo
 
GSP East 2008 - Intro & Welcome
GSP East 2008 - Intro & WelcomeGSP East 2008 - Intro & Welcome
GSP East 2008 - Intro & Welcome
Dave McClure
 
LED pracovní světlo 18W 10-30V
LED pracovní světlo 18W 10-30VLED pracovní světlo 18W 10-30V
LED pracovní světlo 18W 10-30V
Roel Adriaan Ramp
 
Content marketing för e-handel - fördjupning
Content marketing för e-handel - fördjupningContent marketing för e-handel - fördjupning
Content marketing för e-handel - fördjupning
Christer Pettersson
 
Twitter, bloggar, Facebook och YouTube – var ska jag börja?
Twitter, bloggar, Facebook och YouTube – var ska jag börja?Twitter, bloggar, Facebook och YouTube – var ska jag börja?
Twitter, bloggar, Facebook och YouTube – var ska jag börja?
Please copy me
 
Top 10 Rules for Vertical Revolutionaries
Top 10 Rules for Vertical RevolutionariesTop 10 Rules for Vertical Revolutionaries
Top 10 Rules for Vertical Revolutionaries
Dave McClure
 
8 Blogging Tools That You Need to Increase Traffic and Links
8 Blogging Tools That You Need to Increase Traffic and Links8 Blogging Tools That You Need to Increase Traffic and Links
8 Blogging Tools That You Need to Increase Traffic and Links
Venchito Tampon
 
Ad

Similar to AngularJs-training (20)

AngularJs Crash Course
AngularJs Crash CourseAngularJs Crash Course
AngularJs Crash Course
Keith Bloomfield
 
Angular.js Primer in Aalto University
Angular.js Primer in Aalto UniversityAngular.js Primer in Aalto University
Angular.js Primer in Aalto University
SC5.io
 
Dependency Injection pattern in Angular
Dependency Injection pattern in AngularDependency Injection pattern in Angular
Dependency Injection pattern in Angular
Alexe Bogdan
 
CFUGbe talk about Angular JS
CFUGbe talk about Angular JSCFUGbe talk about Angular JS
CFUGbe talk about Angular JS
Alwyn Wymeersch
 
First Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven DevelopmentFirst Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven Development
Nuvole
 
Angular Presentation
Angular PresentationAngular Presentation
Angular Presentation
Adam Moore
 
ngMess: AngularJS Dependency Injection
ngMess: AngularJS Dependency InjectionngMess: AngularJS Dependency Injection
ngMess: AngularJS Dependency Injection
Dzmitry Ivashutsin
 
Get rid of controllers in angular 1.5.x start using component directives
Get rid of controllers in angular 1.5.x start using component directivesGet rid of controllers in angular 1.5.x start using component directives
Get rid of controllers in angular 1.5.x start using component directives
Marios Fakiolas
 
Grails Advanced
Grails Advanced Grails Advanced
Grails Advanced
Saurabh Dixit
 
Angular resolver tutorial
Angular resolver tutorialAngular resolver tutorial
Angular resolver tutorial
Katy Slemon
 
Introduction to angular js
Introduction to angular jsIntroduction to angular js
Introduction to angular js
Marco Vito Moscaritolo
 
Angular2 + rxjs
Angular2 + rxjsAngular2 + rxjs
Angular2 + rxjs
Christoffer Noring
 
AngularJS Custom Directives
AngularJS Custom DirectivesAngularJS Custom Directives
AngularJS Custom Directives
yprodev
 
Custom AngularJS Directives
Custom AngularJS DirectivesCustom AngularJS Directives
Custom AngularJS Directives
yprodev
 
Angular js
Angular jsAngular js
Angular js
Behind D Walls
 
Angular js-crash-course
Angular js-crash-courseAngular js-crash-course
Angular js-crash-course
Keith Bloomfield
 
AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014
Ran Wahle
 
Django Class-based views (Slovenian)
Django Class-based views (Slovenian)Django Class-based views (Slovenian)
Django Class-based views (Slovenian)
Luka Zakrajšek
 
Angular training - Day 3 - custom directives, $http, $resource, setup with ye...
Angular training - Day 3 - custom directives, $http, $resource, setup with ye...Angular training - Day 3 - custom directives, $http, $resource, setup with ye...
Angular training - Day 3 - custom directives, $http, $resource, setup with ye...
murtazahaveliwala
 
Patterns Are Good For Managers
Patterns Are Good For ManagersPatterns Are Good For Managers
Patterns Are Good For Managers
AgileThought
 
Angular.js Primer in Aalto University
Angular.js Primer in Aalto UniversityAngular.js Primer in Aalto University
Angular.js Primer in Aalto University
SC5.io
 
Dependency Injection pattern in Angular
Dependency Injection pattern in AngularDependency Injection pattern in Angular
Dependency Injection pattern in Angular
Alexe Bogdan
 
CFUGbe talk about Angular JS
CFUGbe talk about Angular JSCFUGbe talk about Angular JS
CFUGbe talk about Angular JS
Alwyn Wymeersch
 
First Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven DevelopmentFirst Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven Development
Nuvole
 
Angular Presentation
Angular PresentationAngular Presentation
Angular Presentation
Adam Moore
 
ngMess: AngularJS Dependency Injection
ngMess: AngularJS Dependency InjectionngMess: AngularJS Dependency Injection
ngMess: AngularJS Dependency Injection
Dzmitry Ivashutsin
 
Get rid of controllers in angular 1.5.x start using component directives
Get rid of controllers in angular 1.5.x start using component directivesGet rid of controllers in angular 1.5.x start using component directives
Get rid of controllers in angular 1.5.x start using component directives
Marios Fakiolas
 
Angular resolver tutorial
Angular resolver tutorialAngular resolver tutorial
Angular resolver tutorial
Katy Slemon
 
AngularJS Custom Directives
AngularJS Custom DirectivesAngularJS Custom Directives
AngularJS Custom Directives
yprodev
 
Custom AngularJS Directives
Custom AngularJS DirectivesCustom AngularJS Directives
Custom AngularJS Directives
yprodev
 
AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014
Ran Wahle
 
Django Class-based views (Slovenian)
Django Class-based views (Slovenian)Django Class-based views (Slovenian)
Django Class-based views (Slovenian)
Luka Zakrajšek
 
Angular training - Day 3 - custom directives, $http, $resource, setup with ye...
Angular training - Day 3 - custom directives, $http, $resource, setup with ye...Angular training - Day 3 - custom directives, $http, $resource, setup with ye...
Angular training - Day 3 - custom directives, $http, $resource, setup with ye...
murtazahaveliwala
 
Patterns Are Good For Managers
Patterns Are Good For ManagersPatterns Are Good For Managers
Patterns Are Good For Managers
AgileThought
 
Ad

Recently uploaded (20)

2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 

AngularJs-training

  • 2. Module Module <html ng-app=”myApp” > Config Filter Directive Factory Controller Routes Service Value Provider
  • 4. Expression Syntax Two way binding <p>Hello {{name}}!</p> One way binding <p>Hello {{::name}}!</p>
  • 5. Controller declare /* recommended */ // dashboard.js angular .module('app') .controller('DashboardController', DashboardController); function DashboardController() { } /* avoid */ angular .module('app') .controller('DashboardController', function() { })
  • 6. controllerAs View Syntax <!-- avoid --> <div ng-controller="DashboardController"> {{ name }} </div> <!-- recommended --> <div ng-controller="DashboardController as dashboard"> {{ dashboard.name }} </div>
  • 7. controllerAs Controller Syntax /* avoid */ function DashboardController() { this.name = {}; this.sendMessage = function() { }; } /* recommended */ function DashboardController() { var vm = this; vm.name = {}; vm.sendMessage = function() { }; }
  • 8. Why use controllerAs syntax // avoid <div ng-controller="parentContrl"> {{ title }} <div ng-controller="ChildContrl"> {{ title }} {{ $parent.title }} </div> </div> app.controller('parentContrl', function () { this.title = 'Some title'; }); app.controller('ChildContrl', function () { this.title = 'Some title'; }); // recommend <div ng-controller="parentContrl as parent"> {{ parent.title }} <div ng-controller="ChildContrl as child"> {{ child.title }} {{ parent.title }} </div> </div>
  • 11. Form validation with Core Angular
  • 12. Form validation with angular-auto-validate source: https://github.com/jonsamwell/angular-auto-validate Document: http://jonsamwell.github.io/angular-auto-validate/
  • 13. Form animation source: https://github.com/sachinchoolur/ladda-angular Simple: http://sachinchoolur.github.io/ladda-angular/
  • 14. Submit form with $http Document: https://docs.angularjs.org/api/ng/service/$http $http({ method: 'GET', url: '/someUrl' }).then(function successCallback(response) { // this callback will be called asynchronously // when the response is available }, function errorCallback(response) { // called asynchronously if an error occurs // or server returns response with an error status. });
  • 16. Work with JSON [ { "name":"Billy Williams", "email":"[email protected]", "job":"Actuary", "skill":"PDF Creator", "pic":"https://robohash.org/eanostrumincidunt.jpg?size=120x120u0026set=set1" }, { "name":"Steven Frazier", "email":"[email protected]", "job":"Design Engineer", "skill":"NC-Verilog", "pic":"https://robohash.org/repudiandaeomnisest.bmp?size=120x120u0026set=set1" }, { "name":"Doris Clark", "email":"[email protected]", "job":"Nurse Practicioner", "skill":"Axis", "pic":"https://robohash.org/providentvoluptateet.png?size=120x120u0026set=set1" } ]
  • 17. Show JSON with ngRepeat <div ng-repeat="obj in myObj"> ... </div> <ANY ng-repeat="repeat_expression"> ... </ANY> Example
  • 18. Sorting <div ng-repeat="obj in myObj | orderBy:sortType:sortReverse"> ... </div> sortType: JSON field name Params sortReverse: ascending or descending data
  • 19. Filter keyword: text for search Params <div ng-repeat="obj in myObj | filter:keyword"> ... </div>
  • 20. Service AngularJS world, the services are singleton objects or functions that carry out specific tasks. It holds some business logic. Separation of concern is at the heart while designing an AngularJS application. Your controller must be responsible for binding model data to views using $scope. It does not contain logic to fetch the data or manipulating it. There are 3 type of service factory, service, provider , you can use to communicate data between controller also.
  • 21. Factory Factory Provider Gives us the function's return value ie. You just create an object, add properties to it, then return that same object.When you pass this service into your controller, those properties on the object will now be available in that controller through your factory. (Hypothetical Scenario) Singleton and will only be created once Reusable components Factory are a great way for communicating between controllers like sharing data. Can use other dependencies Usually used when the service instance requires complex creation logic Cannot be injected in .config() function. Used for non configurable services If you're using an object, you could use the factory provider.
  • 22. Service Service Provider Gives us the instance of a function (object)- You just instantiated with the ‘new’ keyword and you’ll add properties to ‘this’ and the service will return ‘this’.When you pass the service into your controller, those properties on ‘this’ will now be available on that controller through your service. (Hypothetical Scenario) Singleton and will only be created once Reusable components Services are used for communication between controllers to share data You can add properties and functions to a service object by using the this keyword Dependencies are injected as constructor arguments Used for simple creation logic Cannot be injected in .config() function. If you're using a class you could use the service provider
  • 23. Provider Providers ● Syntax: module.provider( 'providerName', function ); Result: When declaring providerName as an injectable argument you will be provided with (new ProviderFunction()).$get(). The constructor function is instantiated before the $get method is called - ProviderFunction is the function reference passed to module.provider. Providers have the advantage that they can be configured during the module configuration phase.
  • 24. myApp.provider('helloWorld', function() { // In the provider function, you cannot inject any // service or factory. This can only be done at the // "$get" method. this.name = 'Default'; this.$get = function() { var name = this.name; return { sayHello: function() { return "Hello, " + name + "!" } } }; this.setName = function(name) { this.name = name; }; }); //hey, we can configure a provider! myApp.config(function(helloWorldProvider){ helloWorldProvider.setName('World'); });
  • 25. Connect REST API with ngResource, $http ngResource: https://docs.angularjs.org/api/ngResource $http: https://docs.angularjs.org/api/ng/service/$http
  • 26. function asyncGreet(name) { var deferred = $q.defer(); setTimeout(function() { deferred.notify('About to greet ' + name + '.'); if (okToGreet(name)) { deferred.resolve('Hello, ' + name + '!'); } else { deferred.reject('Greeting ' + name + ' is not allowed.'); } }, 1000); return deferred.promise; } var promise = asyncGreet('Robin Hood'); promise.then(function(greeting) { alert('Success: ' + greeting); }, function(reason) { alert('Failed: ' + reason); }, function(update) { alert('Got notification: ' + update); });
  • 27. Directive Directives are markers on a DOM element which attach a special behavior to it. For example, static HTML does not know how to create and display a date picker widget. To teach HTML this new syntax we need a directive. The directive will somehow create an element that behaves like a date picker. We will see how this is achieved subsequently. syntax : app.directive('helloWorld', function() {...});
  • 28. Directive <!-- recommended --> <my-calendar-range></my-calendar-range> <div my-calendar-range></div> /* recommended */ angular .module('myApp) .directive('helloWorld',helloWorld); function helloWorld() { var directive = { link: link, templateUrl: '/template/hello.html or <div> hello </div>', restrict: 'EA' }; return directive; function link(scope, element, attrs) { /* */ } }
  • 29. Directive isolate ● Share scope ● None isolate ● @ Local Scope Property ● = Local Scope Property ● & Local Scope Property
  • 30. Share Scope angular .module('myApp') .directive('sayHi',sayHi); function sayHi() { var directive = { template: '<div> {{name}} </div>', restrict: 'EA' }; return directive; } angular .module('myApp') .controller('sayHi',hello); function hello($scope) { $scope.name = 'Hi'; } Share scope controller $scope.name = 'Hi' $scope.name = 'Hi' directive
  • 31. None isolate angular .module('myApp') .directive('sayHi',sayHi); function sayHi() { var directive = { scope: {}, template: '<div> {{name}} </div>', restrict: 'EA' }; return directive; } angular .module('myApp') .controller('sayHi',hello); function hello($scope) { $scope.name = 'Hi'; } none isolate controller $scope.name = 'Hi' $scope.name = 'Hi' directive
  • 32. @ Local Scope Property angular .module('myApp') .directive('sayHi',sayHi); function sayHi() { var directive = { scope: {name:'@'}, template: '<div> Hi {{name}} !!</div>', restrict: 'EA' }; return directive; } angular .module('myApp') .controller('sayHi',hello); function hello($scope) { $scope.name = 'Lisa'; } @ scope controller <say-hi name={{name}}></say-hi> Scope:{ name: '@' } directive Use to access string value
  • 33. = Local Scope Property angular .module('myApp') .directive('sayHi',sayHi); function sayHi() { var directive = { scope: { people:'='}, template: '<div> Hi {{peopel.name}} !!</div>', restrict: 'EA' }; return directive; } angular .module('myApp') .controller('sayHi',hello); function hello($scope) { $scope.lisa = { name.'Lisa'; age : 29 }; } = scope two way binding controller <say-hi people=”lisa”></say-hi> scope:{ people: '=' } directive Use to bind object
  • 34. & Local Scope Property angular .module('myApp') .directive('sayHi',sayHi); function sayHi() { var directive = { scope: { people:'='}, template: '<ul><li ng-repeat="name in people">{{name}}</li></ul><button ng-click="action()">swap</button>', restrict: 'EA' }; return directive; } angular .module('myApp') .controller('sayHi',hello); function hello($scope) { $scope.people = ['Lisa', 'John', 'Tom']; $scope.swap = function() { var j, x, i; for (i = $scope.people.length; i; i -= 1) { j = Math.floor(Math.random() * i); x = $scope.people[i - 1]; $scope.people[i - 1] = $scope.people[j]; $scope.people[j] = x; } } } @ scope two way binding controller <say-hi people="people" action="swap()"></say-hi> scope:{ action: '&' } directive Use to call external function
  • 35. Directive link function angular .module('myApp) .directive('helloWorld',helloWorld); function helloWorld() { var directive = { link: link, templateUrl: '<div>{{name}}</div>', restrict: 'EA' }; return directive; function link(scope, element, attrs) { Scope.num = 2; } }
  • 36. Routing app with uiRouter Source & Document: https://github.com/angular-ui/ui-router myApp.config(function($stateProvider, $urlRouterProvider) { $urlRouterProvider.otherwise("/"); $stateProvider .state('state1', { url: "/state1", templateUrl: "partials/state1.html" }) .state('state2', { url: "/state2", templateUrl: "partials/state2.html" }); });
  • 38. Event in system $emit, $broadcast and $on via $scope and $rootScope
  • 39. Promise with $q and build-in $http $q is a service that helps you run functions asynchronously, and use their return values (or exceptions) when they are done processing. This is an implementation of promises/deferred objects inspired by Kris Kowal's Q. $q can be used in two fashions --- one which is more similar to Kris Kowal's Q or jQuery's Deferred implementations, and the other which resembles ES6 (ES2015) promises to some degree.
  • 40. Promise stop hell-callback fn1(function() { fn2(function() { fn3(function() { fn4(function() { // your process }); }); }); });
  • 41. Deep dive a Scope ● Root Scope ● Child Scope ● Dot notation

Editor's Notes

  • #2: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #3: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #4: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #5: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #6: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #7: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #8: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #9: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #10: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #11: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #12: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #13: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #14: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #15: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #16: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #17: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #18: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #19: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #20: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #21: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #22: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #23: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #24: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #25: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #26: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #27: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #28: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #29: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #30: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #31: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #32: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #33: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #34: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #35: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #36: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #37: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #38: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #39: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #40: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #41: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.
  • #42: What is a Module? You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. Why? Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach: The declarative process is easier to understand. You can package code as reusable modules. The modules can be loaded in any order (or even in parallel) because modules delay execution. Unit tests only have to load relevant modules, which keeps them fast. End-to-end tests can use modules to override configuration.