SlideShare a Scribd company logo
AngularJS Training
Mahmoud shaaban
9/9/2015 AngularJS Training 1
About @Me
ā€¢ Solution Architect at Mantrac Group
ā€¢ Skype: Mahmoudfcis
ā€¢ Twitter: @MahmoodTolba
9/9/2015 AngularJS Training 2
Agenda
ļ±Introduction to AngularJS
ļ±AngularJS modules
ļ±Controllers
ļ±Filters and expressions
ļ±Directives
ļ±Factories
ļ±Services
ļ±Routing
ļ±AngularJS unit testing
9/9/2015 AngularJS Training 3
Introduction to AngularJS
ā€¢ JavaScript library developed by Google for building dynamics web
apps.
ā€¢ MV* Framework
ā€¢ Open source
ā€¢ Client side
ā€¢ AngularJS extends vocabulary of HTML
9/9/2015 AngularJS Training 4
AngularJS advantages
ā€¢ Great framework for building dynamic, SPA web applications
ā€¢ AngularJS allows you to control complete DOM structure show/hide,
changing everything with AngularJS properties
ā€¢ Modularity, Support of design patterns, testable framework
ā€¢ You can accomplish 80% of web application functionality using 20% of
AngularJS features
ā€¢ AngularJS learning curve is high
ā€¢ Extensive support and documentation, communities are expanding
ā€¢ Visual Studio Support and Intellisense
9/9/2015 AngularJS Training 5
AngularJS vs. Other frameworks
ā€¢ Backbone, Ember, React are another MV* frameworks
9/9/2015 AngularJS Training 6
AngularJS page life cycle
ā€¢ Bootstrap phase: occurs when the AngularJS library is downloaded to
the browser when the AngularJS initializes its module and its
necessary components, in this phase the module is initialized.
ā€¢ Compilation phase: occurs when the page is loaded , static form of
the DOM is replaced with dynamic DOM.
ā€¢ Runtime data binding phase: any changes in the scope reflected in the
view and any changes in the view are reflected in the scope
9/9/2015 AngularJS Training 7
AngularJS Modules
ā€¢ Is a global place for creating, registering and retrieving Angular
modules
ā€¢ Is a collection of services, directives, controllers, filters, and
configuration information
ā€¢ http://ngmodules.org/ custom AngularJS modules
9/9/2015 AngularJS Training 8
Controllers
ā€¢ They are JS function that binds the view to the Model
ā€¢ Takes at least one parameter: $scope
ā€¢ Ng-controller is used to define a controller in a page
ā€¢ Controllers can be nested with another controllers
ā€¢ Example HTML:
ā€¢ Defining the controller in JS
9/9/2015 AngularJS Training 9
<div ng-controller="GreetingController"> {{ greeting }} </div>
var myApp = angular.module('myApp',[]); myApp.controller('DoubleController', ['$scope', function($scope) { $scope.double = function(value) { return value * 2; }; }]);
Expressions
ā€¢ Angular expressions are JavaScript-like code snippets that are usually
placed in bindings such as {{ expression }}
ā€¢ Example {{1+2}}
ā€¢ AngularJS expressions are similar to JavaScript expressions with
several differences; the context of AngularJS expressions is the scope
object whereas the context of JavaScript context window object.
ā€¢ You cannot write control flow or loop expression inside AngularJS
expression
9/9/2015 AngularJS Training 10
Filters
ā€¢ A filter formats the value of an expression for display to the user. They can
be used in view templates, controllers or services and it is easy to define
your own filter.
ā€¢ Built-in AngularJS filters:
9/9/2015 AngularJS Training 11
Filter Description
currency Format a number to a currency format.
filter Select a subset of items from an array.
lowercase Format a string to lower case.
orderBy Orders an array by an expression.
uppercase Format a string to upper case.
ā€¢ You can build your own filter using module.filter()
Directives
ā€¢ They are markers on a DOM element (such as an attribute, element
name, comment or CSS class) that tell AngularJS's HTML compiler
($compile) to attach a specified behavior to that DOM element or
even transform the DOM element and its children.
ā€¢ Add new vocabulary to HTML
ā€¢ AngularJS comes with plenty of directives ng-app, ng-model, ng-
controller, ng-show, ng-repeat,ng-init
ā€¢ You can build your custom directive using module.directive()
ā€¢ Directives can be used for DOM manipulation
9/9/2015 AngularJS Training 12
Factories & Services
ā€¢ They reusable components that share (business logic, data) across
controllers and directives.
ā€¢ Angular Services are singletons, only one instance of the service per
injector
ā€¢ Service syntax : module.service(ā€˜ServiceNameā€™,function); useful for
Shared Utilities
ā€¢ Factory Syntax: module.factory(ā€˜factoryNameā€™,function);useful for
returning class functions that can be newā€™ed to create instances
9/9/2015 AngularJS Training 13
Routing
ā€¢ Use different views for different URL fragments
ā€¢ Mainly for creating single page applications
ā€¢ Makes use of template partials
ā€¢ Templates that are not a whole web page (i.e. part of a page)
ā€¢ Used in conjunction with the ng-view directive
ā€¢ ng-view determines where the partial will be placed
ā€¢ Can only have one ng-view per page
AngularJS Unit Testing
ā€¢ AngularJS comes with dependency injection built in which makes the
testing easy
ā€¢ Separation of concerns is important for testing
ā€¢ Karma and Jasmine are popular testing frameworks for AngularJS
9/9/2015 AngularJS Training 15

More Related Content

What's hot

Gettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJSGettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJS
Armin Vieweg
Ā 
AngularJs Basic Concept
AngularJs Basic ConceptAngularJs Basic Concept
AngularJs Basic Concept
Hari Haran
Ā 
Angular js for enteprise application
Angular js for enteprise applicationAngular js for enteprise application
Angular js for enteprise application
vu van quyet
Ā 
AngularJS Best Practices
AngularJS Best PracticesAngularJS Best Practices
AngularJS Best Practices
Betclic Everest Group Tech Team
Ā 
Step by Step - AngularJS
Step by Step - AngularJSStep by Step - AngularJS
Step by Step - AngularJS
Infragistics
Ā 
OCTO BOF - How to build Netvibes with AngularJS
OCTO BOF - How to build Netvibes with AngularJSOCTO BOF - How to build Netvibes with AngularJS
OCTO BOF - How to build Netvibes with AngularJSJonathan Meiss
Ā 
Introducing angular
Introducing angularIntroducing angular
Introducing angular
Columbia Developers Guild
Ā 
Deep dive into Vue.js
Deep dive into Vue.jsDeep dive into Vue.js
Deep dive into Vue.js
ģ„ ķ˜‘ ģ“
Ā 
AngularJS One Day Workshop
AngularJS One Day WorkshopAngularJS One Day Workshop
AngularJS One Day Workshop
Shyam Seshadri
Ā 
Single Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJSSingle Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJS
M R Rony
Ā 
React or Angular and SharePoint Framework Development
React or Angular and SharePoint Framework DevelopmentReact or Angular and SharePoint Framework Development
React or Angular and SharePoint Framework Development
Darin Dickey
Ā 
Angular js
Angular jsAngular js
Angular js
Hritesh Saha
Ā 
Angular.js - JS Camp UKraine 2013
Angular.js - JS Camp UKraine 2013Angular.js - JS Camp UKraine 2013
Angular.js - JS Camp UKraine 2013
Max Klymyshyn
Ā 
AngularJS - Architecture decisions in a large projectĀ 
AngularJS - Architecture decisionsin a large projectĀ AngularJS - Architecture decisionsin a large projectĀ 
AngularJS - Architecture decisions in a large projectĀ 
Elad Hirsch
Ā 
Angular vs React: Building modern SharePoint interfaces with SPFx
Angular vs React: Building modern SharePoint interfaces with SPFxAngular vs React: Building modern SharePoint interfaces with SPFx
Angular vs React: Building modern SharePoint interfaces with SPFx
Dimcho Tsanov
Ā 
Angular js
Angular jsAngular js
Angular jsLarry Ball
Ā 
Drupal & AngularJS - DrupalCamp Spain 2014
Drupal & AngularJS - DrupalCamp Spain 2014Drupal & AngularJS - DrupalCamp Spain 2014
Drupal & AngularJS - DrupalCamp Spain 2014
Juampy NR
Ā 

What's hot (20)

AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS Basics
Ā 
Gettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJSGettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJS
Ā 
Angularjs Basics
Angularjs BasicsAngularjs Basics
Angularjs Basics
Ā 
AngularJs Basic Concept
AngularJs Basic ConceptAngularJs Basic Concept
AngularJs Basic Concept
Ā 
Angular js for enteprise application
Angular js for enteprise applicationAngular js for enteprise application
Angular js for enteprise application
Ā 
AngularJS Best Practices
AngularJS Best PracticesAngularJS Best Practices
AngularJS Best Practices
Ā 
Step by Step - AngularJS
Step by Step - AngularJSStep by Step - AngularJS
Step by Step - AngularJS
Ā 
OCTO BOF - How to build Netvibes with AngularJS
OCTO BOF - How to build Netvibes with AngularJSOCTO BOF - How to build Netvibes with AngularJS
OCTO BOF - How to build Netvibes with AngularJS
Ā 
Introducing angular
Introducing angularIntroducing angular
Introducing angular
Ā 
Deep dive into Vue.js
Deep dive into Vue.jsDeep dive into Vue.js
Deep dive into Vue.js
Ā 
AngularJS One Day Workshop
AngularJS One Day WorkshopAngularJS One Day Workshop
AngularJS One Day Workshop
Ā 
Single Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJSSingle Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJS
Ā 
React or Angular and SharePoint Framework Development
React or Angular and SharePoint Framework DevelopmentReact or Angular and SharePoint Framework Development
React or Angular and SharePoint Framework Development
Ā 
Angular js
Angular jsAngular js
Angular js
Ā 
Angular.js - JS Camp UKraine 2013
Angular.js - JS Camp UKraine 2013Angular.js - JS Camp UKraine 2013
Angular.js - JS Camp UKraine 2013
Ā 
AngularJS - Architecture decisions in a large projectĀ 
AngularJS - Architecture decisionsin a large projectĀ AngularJS - Architecture decisionsin a large projectĀ 
AngularJS - Architecture decisions in a large projectĀ 
Ā 
Angular vs React: Building modern SharePoint interfaces with SPFx
Angular vs React: Building modern SharePoint interfaces with SPFxAngular vs React: Building modern SharePoint interfaces with SPFx
Angular vs React: Building modern SharePoint interfaces with SPFx
Ā 
Angular js
Angular jsAngular js
Angular js
Ā 
Angular js
Angular jsAngular js
Angular js
Ā 
Drupal & AngularJS - DrupalCamp Spain 2014
Drupal & AngularJS - DrupalCamp Spain 2014Drupal & AngularJS - DrupalCamp Spain 2014
Drupal & AngularJS - DrupalCamp Spain 2014
Ā 

Viewers also liked

Conferenza OpenGeoData 2016 - La comunitĆ  Open Data Sicilia - Ilaria Vitellio...
Conferenza OpenGeoData 2016 - La comunitĆ  Open Data Sicilia - Ilaria Vitellio...Conferenza OpenGeoData 2016 - La comunitĆ  Open Data Sicilia - Ilaria Vitellio...
Conferenza OpenGeoData 2016 - La comunitĆ  Open Data Sicilia - Ilaria Vitellio...
giovanni biallo
Ā 
Perfil Investimento Anjo, Julho 2014
Perfil Investimento Anjo, Julho 2014Perfil Investimento Anjo, Julho 2014
Perfil Investimento Anjo, Julho 2014
Startupi
Ā 
Importancia de las tic en el preescolar
Importancia de las tic en el preescolarImportancia de las tic en el preescolar
Importancia de las tic en el preescolar
Ana Matilde Sierra Martinez
Ā 
ĀæCĆ³mo usar la tecnologĆ­a para aumentar la venta de viajes?
ĀæCĆ³mo usar la tecnologĆ­a para aumentar la venta de viajes?ĀæCĆ³mo usar la tecnologĆ­a para aumentar la venta de viajes?
ĀæCĆ³mo usar la tecnologĆ­a para aumentar la venta de viajes?
Indra Company
Ā 
EstratƩgias para Sair da Crise - A Nova Ordem Social e o CenƔrio Atual
EstratƩgias para Sair da Crise - A Nova Ordem Social e o CenƔrio AtualEstratƩgias para Sair da Crise - A Nova Ordem Social e o CenƔrio Atual
EstratƩgias para Sair da Crise - A Nova Ordem Social e o CenƔrio Atual
Conselho Regional de AdministraĆ§Ć£o de SĆ£o Paulo
Ā 
Mobile app testing
Mobile app testingMobile app testing
Mobile app testing
InApp
Ā 
Webshoppers 26
Webshoppers 26Webshoppers 26
Webshoppers 26
Startupi
Ā 
Angular JS Introduction
Angular JS IntroductionAngular JS Introduction
Angular JS Introduction
Dhyego Fernando
Ā 
BeModels - Identidade Visual
BeModels - Identidade VisualBeModels - Identidade Visual
BeModels - Identidade Visual
AgĆŖncia NNcorp
Ā 
Camila Fontoura - CriaĆ§Ć£o Identidade Visual
Camila Fontoura - CriaĆ§Ć£o Identidade VisualCamila Fontoura - CriaĆ§Ć£o Identidade Visual
Camila Fontoura - CriaĆ§Ć£o Identidade Visual
AgĆŖncia NNcorp
Ā 
Javascript Frameworks
Javascript FrameworksJavascript Frameworks
Javascript FrameworksMitesh Gandhi
Ā 
Comparatif des frameworks js mv
Comparatif des frameworks js mvComparatif des frameworks js mv
Comparatif des frameworks js mv
Mael Monnier
Ā 
A History of Ireland, Scotland and Wales - A Course by Dr. Lizabeth Johnson -...
A History of Ireland, Scotland and Wales - A Course by Dr. Lizabeth Johnson -...A History of Ireland, Scotland and Wales - A Course by Dr. Lizabeth Johnson -...
A History of Ireland, Scotland and Wales - A Course by Dr. Lizabeth Johnson -...
UNM Continuing Education
Ā 
Introduction Ć  Angular 2
Introduction Ć  Angular 2Introduction Ć  Angular 2
Introduction Ć  Angular 2
Laurent Duveau
Ā 
Morgenbooster #63 | Tools for Insights
Morgenbooster #63 | Tools for InsightsMorgenbooster #63 | Tools for Insights
Morgenbooster #63 | Tools for Insights
1508 A/S
Ā 
Morgenbooster #62 | Fighting Monsters
Morgenbooster #62 | Fighting MonstersMorgenbooster #62 | Fighting Monsters
Morgenbooster #62 | Fighting Monsters
1508 A/S
Ā 

Viewers also liked (16)

Conferenza OpenGeoData 2016 - La comunitĆ  Open Data Sicilia - Ilaria Vitellio...
Conferenza OpenGeoData 2016 - La comunitĆ  Open Data Sicilia - Ilaria Vitellio...Conferenza OpenGeoData 2016 - La comunitĆ  Open Data Sicilia - Ilaria Vitellio...
Conferenza OpenGeoData 2016 - La comunitĆ  Open Data Sicilia - Ilaria Vitellio...
Ā 
Perfil Investimento Anjo, Julho 2014
Perfil Investimento Anjo, Julho 2014Perfil Investimento Anjo, Julho 2014
Perfil Investimento Anjo, Julho 2014
Ā 
Importancia de las tic en el preescolar
Importancia de las tic en el preescolarImportancia de las tic en el preescolar
Importancia de las tic en el preescolar
Ā 
ĀæCĆ³mo usar la tecnologĆ­a para aumentar la venta de viajes?
ĀæCĆ³mo usar la tecnologĆ­a para aumentar la venta de viajes?ĀæCĆ³mo usar la tecnologĆ­a para aumentar la venta de viajes?
ĀæCĆ³mo usar la tecnologĆ­a para aumentar la venta de viajes?
Ā 
EstratƩgias para Sair da Crise - A Nova Ordem Social e o CenƔrio Atual
EstratƩgias para Sair da Crise - A Nova Ordem Social e o CenƔrio AtualEstratƩgias para Sair da Crise - A Nova Ordem Social e o CenƔrio Atual
EstratƩgias para Sair da Crise - A Nova Ordem Social e o CenƔrio Atual
Ā 
Mobile app testing
Mobile app testingMobile app testing
Mobile app testing
Ā 
Webshoppers 26
Webshoppers 26Webshoppers 26
Webshoppers 26
Ā 
Angular JS Introduction
Angular JS IntroductionAngular JS Introduction
Angular JS Introduction
Ā 
BeModels - Identidade Visual
BeModels - Identidade VisualBeModels - Identidade Visual
BeModels - Identidade Visual
Ā 
Camila Fontoura - CriaĆ§Ć£o Identidade Visual
Camila Fontoura - CriaĆ§Ć£o Identidade VisualCamila Fontoura - CriaĆ§Ć£o Identidade Visual
Camila Fontoura - CriaĆ§Ć£o Identidade Visual
Ā 
Javascript Frameworks
Javascript FrameworksJavascript Frameworks
Javascript Frameworks
Ā 
Comparatif des frameworks js mv
Comparatif des frameworks js mvComparatif des frameworks js mv
Comparatif des frameworks js mv
Ā 
A History of Ireland, Scotland and Wales - A Course by Dr. Lizabeth Johnson -...
A History of Ireland, Scotland and Wales - A Course by Dr. Lizabeth Johnson -...A History of Ireland, Scotland and Wales - A Course by Dr. Lizabeth Johnson -...
A History of Ireland, Scotland and Wales - A Course by Dr. Lizabeth Johnson -...
Ā 
Introduction Ć  Angular 2
Introduction Ć  Angular 2Introduction Ć  Angular 2
Introduction Ć  Angular 2
Ā 
Morgenbooster #63 | Tools for Insights
Morgenbooster #63 | Tools for InsightsMorgenbooster #63 | Tools for Insights
Morgenbooster #63 | Tools for Insights
Ā 
Morgenbooster #62 | Fighting Monsters
Morgenbooster #62 | Fighting MonstersMorgenbooster #62 | Fighting Monsters
Morgenbooster #62 | Fighting Monsters
Ā 

Similar to AngularJS

Angularjs
AngularjsAngularjs
Angularjs
Sabin Tamrakar
Ā 
Learning AngularJS - Complete coverage of AngularJS features and concepts
Learning AngularJS  - Complete coverage of AngularJS features and conceptsLearning AngularJS  - Complete coverage of AngularJS features and concepts
Learning AngularJS - Complete coverage of AngularJS features and concepts
Suresh Patidar
Ā 
Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to Angularjs
Gaurav Agrawal
Ā 
Angularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetupAngularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetupGoutam Dey
Ā 
Angular js
Angular jsAngular js
Angular js
vu van quyet
Ā 
AngularJs (1.x) Presentation
AngularJs (1.x) PresentationAngularJs (1.x) Presentation
AngularJs (1.x) Presentation
Raghubir Singh
Ā 
Angular JS Indtrodution
Angular JS IndtrodutionAngular JS Indtrodution
Angular JS Indtrodution
adesh21
Ā 
Angular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaAngular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad india
php2ranjan
Ā 
CraftCamp for Students - Introduction to AngularJS
CraftCamp for Students - Introduction to AngularJSCraftCamp for Students - Introduction to AngularJS
CraftCamp for Students - Introduction to AngularJS
craftworkz
Ā 
AngularJS: Overview & Key Features
AngularJS: Overview & Key FeaturesAngularJS: Overview & Key Features
AngularJS: Overview & Key Features
Mohamad Al Asmar
Ā 
AngularJS is awesome
AngularJS is awesomeAngularJS is awesome
AngularJS is awesome
Eusebiu Schipor
Ā 
End to-End SPA Development Using ASP.NET and AngularJS
End to-End SPA Development Using ASP.NET and AngularJSEnd to-End SPA Development Using ASP.NET and AngularJS
End to-End SPA Development Using ASP.NET and AngularJS
Gil Fink
Ā 
Valentine with Angular js - Introduction
Valentine with Angular js - IntroductionValentine with Angular js - Introduction
Valentine with Angular js - Introduction
Senthil Kumar
Ā 
AngularJS By Vipin
AngularJS By VipinAngularJS By Vipin
AngularJS By Vipin
Vipin Mundayad
Ā 
Anjular js
Anjular jsAnjular js
Anjular js
Naga Dinesh
Ā 
What are the key distinctions between Angular and AngularJS?
What are the key distinctions between Angular and AngularJS?What are the key distinctions between Angular and AngularJS?
What are the key distinctions between Angular and AngularJS?
Albiorix Technology
Ā 
AngularJS in practice
AngularJS in practiceAngularJS in practice
AngularJS in practice
Eugene Fidelin
Ā 
Overview of the AngularJS framework
Overview of the AngularJS framework Overview of the AngularJS framework
Overview of the AngularJS framework
Yakov Fain
Ā 
AngularJS Introduction, how to run Angular
AngularJS Introduction, how to run AngularAngularJS Introduction, how to run Angular
AngularJS Introduction, how to run Angular
SamuelJohnpeter
Ā 
Angular js
Angular jsAngular js
Angular js
Baldeep Sohal
Ā 

Similar to AngularJS (20)

Angularjs
AngularjsAngularjs
Angularjs
Ā 
Learning AngularJS - Complete coverage of AngularJS features and concepts
Learning AngularJS  - Complete coverage of AngularJS features and conceptsLearning AngularJS  - Complete coverage of AngularJS features and concepts
Learning AngularJS - Complete coverage of AngularJS features and concepts
Ā 
Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to Angularjs
Ā 
Angularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetupAngularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetup
Ā 
Angular js
Angular jsAngular js
Angular js
Ā 
AngularJs (1.x) Presentation
AngularJs (1.x) PresentationAngularJs (1.x) Presentation
AngularJs (1.x) Presentation
Ā 
Angular JS Indtrodution
Angular JS IndtrodutionAngular JS Indtrodution
Angular JS Indtrodution
Ā 
Angular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaAngular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad india
Ā 
CraftCamp for Students - Introduction to AngularJS
CraftCamp for Students - Introduction to AngularJSCraftCamp for Students - Introduction to AngularJS
CraftCamp for Students - Introduction to AngularJS
Ā 
AngularJS: Overview & Key Features
AngularJS: Overview & Key FeaturesAngularJS: Overview & Key Features
AngularJS: Overview & Key Features
Ā 
AngularJS is awesome
AngularJS is awesomeAngularJS is awesome
AngularJS is awesome
Ā 
End to-End SPA Development Using ASP.NET and AngularJS
End to-End SPA Development Using ASP.NET and AngularJSEnd to-End SPA Development Using ASP.NET and AngularJS
End to-End SPA Development Using ASP.NET and AngularJS
Ā 
Valentine with Angular js - Introduction
Valentine with Angular js - IntroductionValentine with Angular js - Introduction
Valentine with Angular js - Introduction
Ā 
AngularJS By Vipin
AngularJS By VipinAngularJS By Vipin
AngularJS By Vipin
Ā 
Anjular js
Anjular jsAnjular js
Anjular js
Ā 
What are the key distinctions between Angular and AngularJS?
What are the key distinctions between Angular and AngularJS?What are the key distinctions between Angular and AngularJS?
What are the key distinctions between Angular and AngularJS?
Ā 
AngularJS in practice
AngularJS in practiceAngularJS in practice
AngularJS in practice
Ā 
Overview of the AngularJS framework
Overview of the AngularJS framework Overview of the AngularJS framework
Overview of the AngularJS framework
Ā 
AngularJS Introduction, how to run Angular
AngularJS Introduction, how to run AngularAngularJS Introduction, how to run Angular
AngularJS Introduction, how to run Angular
Ā 
Angular js
Angular jsAngular js
Angular js
Ā 

More from Mahmoud Tolba

The passionate programmer
The passionate programmerThe passionate programmer
The passionate programmer
Mahmoud Tolba
Ā 
Introduction to SAP, Systems, Applications
Introduction to SAP, Systems, ApplicationsIntroduction to SAP, Systems, Applications
Introduction to SAP, Systems, Applications
Mahmoud Tolba
Ā 
Developing cross platforms mobile applications using the Apache Cordova
Developing cross platforms mobile applications using the Apache CordovaDeveloping cross platforms mobile applications using the Apache Cordova
Developing cross platforms mobile applications using the Apache Cordova
Mahmoud Tolba
Ā 
JQuery Overview
JQuery OverviewJQuery Overview
JQuery Overview
Mahmoud Tolba
Ā 
Microsoft Entity Framework
Microsoft Entity FrameworkMicrosoft Entity Framework
Microsoft Entity Framework
Mahmoud Tolba
Ā 
Windows Communication Foundation
Windows Communication FoundationWindows Communication Foundation
Windows Communication FoundationMahmoud Tolba
Ā 
ASP.NET MVC controllers
ASP.NET MVC controllersASP.NET MVC controllers
ASP.NET MVC controllersMahmoud Tolba
Ā 
ASP.NET MVC4 Overview
ASP.NET MVC4 OverviewASP.NET MVC4 Overview
ASP.NET MVC4 Overview
Mahmoud Tolba
Ā 
Top emerging technologies
Top emerging technologiesTop emerging technologies
Top emerging technologies
Mahmoud Tolba
Ā 
Advanced JavaScript
Advanced JavaScriptAdvanced JavaScript
Advanced JavaScriptMahmoud Tolba
Ā 

More from Mahmoud Tolba (10)

The passionate programmer
The passionate programmerThe passionate programmer
The passionate programmer
Ā 
Introduction to SAP, Systems, Applications
Introduction to SAP, Systems, ApplicationsIntroduction to SAP, Systems, Applications
Introduction to SAP, Systems, Applications
Ā 
Developing cross platforms mobile applications using the Apache Cordova
Developing cross platforms mobile applications using the Apache CordovaDeveloping cross platforms mobile applications using the Apache Cordova
Developing cross platforms mobile applications using the Apache Cordova
Ā 
JQuery Overview
JQuery OverviewJQuery Overview
JQuery Overview
Ā 
Microsoft Entity Framework
Microsoft Entity FrameworkMicrosoft Entity Framework
Microsoft Entity Framework
Ā 
Windows Communication Foundation
Windows Communication FoundationWindows Communication Foundation
Windows Communication Foundation
Ā 
ASP.NET MVC controllers
ASP.NET MVC controllersASP.NET MVC controllers
ASP.NET MVC controllers
Ā 
ASP.NET MVC4 Overview
ASP.NET MVC4 OverviewASP.NET MVC4 Overview
ASP.NET MVC4 Overview
Ā 
Top emerging technologies
Top emerging technologiesTop emerging technologies
Top emerging technologies
Ā 
Advanced JavaScript
Advanced JavaScriptAdvanced JavaScript
Advanced JavaScript
Ā 

Recently uploaded

Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
Ā 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
Ā 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
Ā 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
Ā 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
Ā 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
ShamsuddeenMuhammadA
Ā 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
Ā 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
Ā 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
Ā 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
Ā 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
Ā 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
Ā 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
Ā 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
Ā 
Dominate Social Media with TubeTrivia AIā€™s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AIā€™s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AIā€™s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AIā€™s Addictive Quiz Videos.pdf
AMB-Review
Ā 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
Ā 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
Ā 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
Ā 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni GarcĆ­a
Ā 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
Ā 

Recently uploaded (20)

Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Ā 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Ā 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
Ā 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Ā 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Ā 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Ā 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Ā 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Ā 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ā 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Ā 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Ā 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Ā 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
Ā 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Ā 
Dominate Social Media with TubeTrivia AIā€™s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AIā€™s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AIā€™s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AIā€™s Addictive Quiz Videos.pdf
Ā 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Ā 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Ā 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Ā 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Ā 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Ā 

AngularJS

  • 2. About @Me ā€¢ Solution Architect at Mantrac Group ā€¢ Skype: Mahmoudfcis ā€¢ Twitter: @MahmoodTolba 9/9/2015 AngularJS Training 2
  • 3. Agenda ļ±Introduction to AngularJS ļ±AngularJS modules ļ±Controllers ļ±Filters and expressions ļ±Directives ļ±Factories ļ±Services ļ±Routing ļ±AngularJS unit testing 9/9/2015 AngularJS Training 3
  • 4. Introduction to AngularJS ā€¢ JavaScript library developed by Google for building dynamics web apps. ā€¢ MV* Framework ā€¢ Open source ā€¢ Client side ā€¢ AngularJS extends vocabulary of HTML 9/9/2015 AngularJS Training 4
  • 5. AngularJS advantages ā€¢ Great framework for building dynamic, SPA web applications ā€¢ AngularJS allows you to control complete DOM structure show/hide, changing everything with AngularJS properties ā€¢ Modularity, Support of design patterns, testable framework ā€¢ You can accomplish 80% of web application functionality using 20% of AngularJS features ā€¢ AngularJS learning curve is high ā€¢ Extensive support and documentation, communities are expanding ā€¢ Visual Studio Support and Intellisense 9/9/2015 AngularJS Training 5
  • 6. AngularJS vs. Other frameworks ā€¢ Backbone, Ember, React are another MV* frameworks 9/9/2015 AngularJS Training 6
  • 7. AngularJS page life cycle ā€¢ Bootstrap phase: occurs when the AngularJS library is downloaded to the browser when the AngularJS initializes its module and its necessary components, in this phase the module is initialized. ā€¢ Compilation phase: occurs when the page is loaded , static form of the DOM is replaced with dynamic DOM. ā€¢ Runtime data binding phase: any changes in the scope reflected in the view and any changes in the view are reflected in the scope 9/9/2015 AngularJS Training 7
  • 8. AngularJS Modules ā€¢ Is a global place for creating, registering and retrieving Angular modules ā€¢ Is a collection of services, directives, controllers, filters, and configuration information ā€¢ http://ngmodules.org/ custom AngularJS modules 9/9/2015 AngularJS Training 8
  • 9. Controllers ā€¢ They are JS function that binds the view to the Model ā€¢ Takes at least one parameter: $scope ā€¢ Ng-controller is used to define a controller in a page ā€¢ Controllers can be nested with another controllers ā€¢ Example HTML: ā€¢ Defining the controller in JS 9/9/2015 AngularJS Training 9 <div ng-controller="GreetingController"> {{ greeting }} </div> var myApp = angular.module('myApp',[]); myApp.controller('DoubleController', ['$scope', function($scope) { $scope.double = function(value) { return value * 2; }; }]);
  • 10. Expressions ā€¢ Angular expressions are JavaScript-like code snippets that are usually placed in bindings such as {{ expression }} ā€¢ Example {{1+2}} ā€¢ AngularJS expressions are similar to JavaScript expressions with several differences; the context of AngularJS expressions is the scope object whereas the context of JavaScript context window object. ā€¢ You cannot write control flow or loop expression inside AngularJS expression 9/9/2015 AngularJS Training 10
  • 11. Filters ā€¢ A filter formats the value of an expression for display to the user. They can be used in view templates, controllers or services and it is easy to define your own filter. ā€¢ Built-in AngularJS filters: 9/9/2015 AngularJS Training 11 Filter Description currency Format a number to a currency format. filter Select a subset of items from an array. lowercase Format a string to lower case. orderBy Orders an array by an expression. uppercase Format a string to upper case. ā€¢ You can build your own filter using module.filter()
  • 12. Directives ā€¢ They are markers on a DOM element (such as an attribute, element name, comment or CSS class) that tell AngularJS's HTML compiler ($compile) to attach a specified behavior to that DOM element or even transform the DOM element and its children. ā€¢ Add new vocabulary to HTML ā€¢ AngularJS comes with plenty of directives ng-app, ng-model, ng- controller, ng-show, ng-repeat,ng-init ā€¢ You can build your custom directive using module.directive() ā€¢ Directives can be used for DOM manipulation 9/9/2015 AngularJS Training 12
  • 13. Factories & Services ā€¢ They reusable components that share (business logic, data) across controllers and directives. ā€¢ Angular Services are singletons, only one instance of the service per injector ā€¢ Service syntax : module.service(ā€˜ServiceNameā€™,function); useful for Shared Utilities ā€¢ Factory Syntax: module.factory(ā€˜factoryNameā€™,function);useful for returning class functions that can be newā€™ed to create instances 9/9/2015 AngularJS Training 13
  • 14. Routing ā€¢ Use different views for different URL fragments ā€¢ Mainly for creating single page applications ā€¢ Makes use of template partials ā€¢ Templates that are not a whole web page (i.e. part of a page) ā€¢ Used in conjunction with the ng-view directive ā€¢ ng-view determines where the partial will be placed ā€¢ Can only have one ng-view per page
  • 15. AngularJS Unit Testing ā€¢ AngularJS comes with dependency injection built in which makes the testing easy ā€¢ Separation of concerns is important for testing ā€¢ Karma and Jasmine are popular testing frameworks for AngularJS 9/9/2015 AngularJS Training 15