SlideShare a Scribd company logo
1 of 25
Download to read offline
AngularJs
An introduction
Outline
●   What is Angular
●   Why Angular
●   How Angular
●   Angular world vs JQuery world
●   Where to use
●   Where not to use
●   Why it is special
What is Angular




     HTML enhanced for web apps!
What is Angular

A Javascript library that allows you to

● EXTEND the functionalities of HTML
● model-view view-model BINDING
● Segregate javascipt logic from HTML
  rendering
● Provides MVC framework for the messy
  javascript
Why Angular
EXTEND the functionalities of HTML

HTML
<input size="30" type="text" class="richtext"/>


Angular way
<input size="30" type="richtext"/>
Why Angular
WHY EXTEND the functionalities of HTML?
● HTML is not enough, we need
  ○   Rich text
  ○   Date picker
  ○   Iterator for dynamic contents
  ○   etc...
● HTML is build to show static data
  ○ Angular makes HTML dynamic
Why Angular
model-view view-model BINDING

● Any changes in javascript model will impact
  the HTML view
● Any changes in HTML view will impact the
  javascript model
Why Angular
model-view view-model BINDING

HTML
<input size="30" type="text" ng-model="checkIn.
start_date"/>

Javascript
function CheckInsCtrl($scope) {
  $scope.checkIn = {start_date: '2013-02-13'};
}
Why Angular
Segregate javascipt logic from HTML
rendering

Advantage
● Helps to reuse logic as it is not coupled with
  HTML DOM
● Less coupling with the framework itself, as
  the library written with plain javascript.
How Angular
HTML

<html>
  <head>
     <script src="angular.js"></script>
  </head>
  <body ng-app>
   {{checkIn.rooms_count}}
  </body>
</html>

● Add angular js in the header
● Add ng-app in the body
How Angular
Javascript

function CheckInsCtrl($scope) {
  $scope.checkIn = {rooms_count: 0};
}


● Define controller and binding data
How Angular :: expression
Javascript
function CheckInsCtrl($scope) {
  $scope.checkIn = {rooms_count: 0};
}

HTML
{{checkIn.rooms_count}}


● Use {{}} to represent expression
● Anguler is forgiving for expression evaluation
How Angular :: binding
HTML
<input ng-datepicker type="text" ng-model="checkIn.start_date"/>
<input ng-datepicker type="text" ng-model="checkIn.end_date"/>
<select ng-model="checkIn.night_counts">
   <option value="1">1</option>
   <option value="2">2</option>
   <option value="3">3</option>
   ...
</select>



● Use ng-model to bind with controller data
How Angular :: binding
Javascript

function CheckInsCtrl($scope) {
  $scope.checkIn = {start_date: '2013-02-16 12:00 AM',
     end_date: '2013-02-17 12:00 AM',
     night_counts: 1};
}



● Define model data
How Angular :: watching
Javascript
Observe changes with $watch
function CheckInsCtrl($scope) {
  $scope.checkIn = {start_date: '2013-02-16 12:00 AM',
     end_date: '2013-02-17 12:00 AM',
     night_counts: 1};

    $scope.$watch('checkIn.start_date + checkIn.end_date', function () {
        if (isValidMoment($scope.checkIn.start_date)
            && isValidMoment($scope.checkIn.end_date)) {
            $scope.updateNightCount();
        }
    });
}
Angular world vs JQuery world
● Accessing angular from jquery
● Accessing jquery from angular
Accessing angular from jquery
Dom generated by angular

<div ng-controller="CheckInsCtrl" class="ng-scope">
  ....
</div>

A scope is defined at the root element.
Accessing angular from jquery
Scope can be accessed as following,

var scope = $(elem).scope();


But the elem should have the "ng-scope"
class.
Which denotes that there is a scope bound with
that element.
Accessing angular from jquery

<div ng-controller="CheckInsCtrl" class="ng-scope">
  ....
</div>


var scope = $($('[ng-controller="CheckInsCtrl"]')[0]).
scope();

Root scope is defined at the root element.
Accessing jquery from angular
Angular can access dom by,
● Angular directives
Where to use Angular
● Complex user end UI
  ○ Where you have a lot of dom event and dom
    manipulation
● One page application
Where not to use Angular
● It is a overkill for simple application where
  you do not need a lot of client side logic
Why it is special
● The target of angular is uniq
● It helps you to extend HTML
  ○ Add new attribute, element that the browser will
    understand
● It operates on dom, unlike other libraries
  that operates on template libraries(String
  based parsing)
● Can use a plain Javascript Hash for a
  model object, unlike EmberJs
References
● angularjs.org
● slideshare.net/AgentK/angularjs-for-
  designers-and-developers
Author

A.K.M. Ashrafuzzaman
Lead Software Engineer,
Tasawr Interactive

www.ashrafuzzaman.com
zmn.ashraf@gmail.com

More Related Content

What's hot

AngularJS for Java Developers
AngularJS for Java DevelopersAngularJS for Java Developers
AngularJS for Java DevelopersLoc Nguyen
 
How Angular2 Can Improve Your AngularJS Apps Today!
How Angular2 Can Improve Your AngularJS Apps Today!How Angular2 Can Improve Your AngularJS Apps Today!
How Angular2 Can Improve Your AngularJS Apps Today!Nir Kaufman
 
AngularJS (1.x) as fast as a lightning
AngularJS (1.x)as fast as a lightningAngularJS (1.x)as fast as a lightning
AngularJS (1.x) as fast as a lightningBartłomiej Narożnik
 
Angular js 2
Angular js 2Angular js 2
Angular js 2Ran Wahle
 
AngularJS Introduction
AngularJS IntroductionAngularJS Introduction
AngularJS IntroductionBrajesh Yadav
 
Combining Angular and React Together
Combining Angular and React TogetherCombining Angular and React Together
Combining Angular and React TogetherSebastian Pederiva
 
Overview of the AngularJS framework
Overview of the AngularJS framework Overview of the AngularJS framework
Overview of the AngularJS framework Yakov Fain
 
Workshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte IWorkshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte IVisual Engineering
 
AngularJS Internal
AngularJS InternalAngularJS Internal
AngularJS InternalEyal Vardi
 
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.xEyal Vardi
 
Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Eliran Eliassy
 
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
 
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Dan Wahlin
 
Workshop 14: AngularJS Parte III
Workshop 14: AngularJS Parte IIIWorkshop 14: AngularJS Parte III
Workshop 14: AngularJS Parte IIIVisual Engineering
 

What's hot (20)

AngularJS for Java Developers
AngularJS for Java DevelopersAngularJS for Java Developers
AngularJS for Java Developers
 
AngularJS Workshop
AngularJS WorkshopAngularJS Workshop
AngularJS Workshop
 
How Angular2 Can Improve Your AngularJS Apps Today!
How Angular2 Can Improve Your AngularJS Apps Today!How Angular2 Can Improve Your AngularJS Apps Today!
How Angular2 Can Improve Your AngularJS Apps Today!
 
AngularJS (1.x) as fast as a lightning
AngularJS (1.x)as fast as a lightningAngularJS (1.x)as fast as a lightning
AngularJS (1.x) as fast as a lightning
 
Angular js 2
Angular js 2Angular js 2
Angular js 2
 
AngularJS Introduction
AngularJS IntroductionAngularJS Introduction
AngularJS Introduction
 
Combining Angular and React Together
Combining Angular and React TogetherCombining Angular and React Together
Combining Angular and React Together
 
Ngrx meta reducers
Ngrx meta reducersNgrx meta reducers
Ngrx meta reducers
 
Routing to components
Routing to componentsRouting to components
Routing to components
 
Overview of the AngularJS framework
Overview of the AngularJS framework Overview of the AngularJS framework
Overview of the AngularJS framework
 
Workshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte IWorkshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte I
 
AngularJS Internal
AngularJS InternalAngularJS Internal
AngularJS Internal
 
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
 
Angularjs
AngularjsAngularjs
Angularjs
 
Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics
 
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.
 
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
 
Ractive js
Ractive jsRactive js
Ractive js
 
Understanding AJAX
Understanding AJAXUnderstanding AJAX
Understanding AJAX
 
Workshop 14: AngularJS Parte III
Workshop 14: AngularJS Parte IIIWorkshop 14: AngularJS Parte III
Workshop 14: AngularJS Parte III
 

Viewers also liked

Preparing our students for Web 3.0 learning
Preparing our students for Web 3.0 learningPreparing our students for Web 3.0 learning
Preparing our students for Web 3.0 learningJudy O'Connell
 
Trigger Agency Profile - Advertising and Digital Marketing Services
Trigger Agency Profile - Advertising and Digital Marketing ServicesTrigger Agency Profile - Advertising and Digital Marketing Services
Trigger Agency Profile - Advertising and Digital Marketing ServicesTrigger Advertising
 
My Amsterdam (presented at SDinGov 2017)
My Amsterdam (presented at SDinGov 2017)My Amsterdam (presented at SDinGov 2017)
My Amsterdam (presented at SDinGov 2017)Peter Boersma
 
Hampton Roads AMA - 2017 Trends in Digital Marketing
Hampton Roads AMA - 2017 Trends in Digital MarketingHampton Roads AMA - 2017 Trends in Digital Marketing
Hampton Roads AMA - 2017 Trends in Digital MarketingGrant Simmons
 
Xu hướng Digital marketing 2016 -2017 - 2018 - bản đầy đủ nhất Thế giới
Xu hướng Digital marketing 2016 -2017 - 2018 - bản đầy đủ nhất Thế giớiXu hướng Digital marketing 2016 -2017 - 2018 - bản đầy đủ nhất Thế giới
Xu hướng Digital marketing 2016 -2017 - 2018 - bản đầy đủ nhất Thế giớiVinalink Media JSC
 
The Next Big Thing is Web 3.0. Catch It If You Can
The Next Big Thing is Web 3.0. Catch It If You Can The Next Big Thing is Web 3.0. Catch It If You Can
The Next Big Thing is Web 3.0. Catch It If You Can Judy O'Connell
 
We Create Digital Success Stories!
We Create Digital Success Stories!We Create Digital Success Stories!
We Create Digital Success Stories!Talha Mujahid
 
TEN Creative Design Agency Creds
TEN Creative Design Agency CredsTEN Creative Design Agency Creds
TEN Creative Design Agency CredsTEN Creative
 
LEAP Agency Company Profile
LEAP Agency Company ProfileLEAP Agency Company Profile
LEAP Agency Company ProfilePrecision Group
 

Viewers also liked (12)

Lavan digital marketing-Company profile-April 2017
Lavan digital marketing-Company profile-April 2017Lavan digital marketing-Company profile-April 2017
Lavan digital marketing-Company profile-April 2017
 
Preparing our students for Web 3.0 learning
Preparing our students for Web 3.0 learningPreparing our students for Web 3.0 learning
Preparing our students for Web 3.0 learning
 
Trigger Agency Profile - Advertising and Digital Marketing Services
Trigger Agency Profile - Advertising and Digital Marketing ServicesTrigger Agency Profile - Advertising and Digital Marketing Services
Trigger Agency Profile - Advertising and Digital Marketing Services
 
My Amsterdam (presented at SDinGov 2017)
My Amsterdam (presented at SDinGov 2017)My Amsterdam (presented at SDinGov 2017)
My Amsterdam (presented at SDinGov 2017)
 
Web Security
Web SecurityWeb Security
Web Security
 
Hampton Roads AMA - 2017 Trends in Digital Marketing
Hampton Roads AMA - 2017 Trends in Digital MarketingHampton Roads AMA - 2017 Trends in Digital Marketing
Hampton Roads AMA - 2017 Trends in Digital Marketing
 
Xu hướng Digital marketing 2016 -2017 - 2018 - bản đầy đủ nhất Thế giới
Xu hướng Digital marketing 2016 -2017 - 2018 - bản đầy đủ nhất Thế giớiXu hướng Digital marketing 2016 -2017 - 2018 - bản đầy đủ nhất Thế giới
Xu hướng Digital marketing 2016 -2017 - 2018 - bản đầy đủ nhất Thế giới
 
The Next Big Thing is Web 3.0. Catch It If You Can
The Next Big Thing is Web 3.0. Catch It If You Can The Next Big Thing is Web 3.0. Catch It If You Can
The Next Big Thing is Web 3.0. Catch It If You Can
 
We Create Digital Success Stories!
We Create Digital Success Stories!We Create Digital Success Stories!
We Create Digital Success Stories!
 
Mix Digital Marketing Agency Credentials
Mix Digital Marketing Agency CredentialsMix Digital Marketing Agency Credentials
Mix Digital Marketing Agency Credentials
 
TEN Creative Design Agency Creds
TEN Creative Design Agency CredsTEN Creative Design Agency Creds
TEN Creative Design Agency Creds
 
LEAP Agency Company Profile
LEAP Agency Company ProfileLEAP Agency Company Profile
LEAP Agency Company Profile
 

Similar to Angular js - the beginning

Coffee@DBG - Exploring Angular JS
Coffee@DBG - Exploring Angular JSCoffee@DBG - Exploring Angular JS
Coffee@DBG - Exploring Angular JSDeepu S Nath
 
Integrating AngularJS into the Campus CMS
Integrating AngularJS into the Campus CMSIntegrating AngularJS into the Campus CMS
Integrating AngularJS into the Campus CMSTom Borger
 
Angular workshop - Full Development Guide
Angular workshop - Full Development GuideAngular workshop - Full Development Guide
Angular workshop - Full Development GuideNitin Giri
 
AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS BasicsRavi Mone
 
ANGULAR JS TRAINING IN PUNE
ANGULAR JS TRAINING IN PUNEANGULAR JS TRAINING IN PUNE
ANGULAR JS TRAINING IN PUNEcncwebworld
 
Angular.js опыт использования, проблемы и решения
Angular.js опыт использования, проблемы и решенияAngular.js опыт использования, проблемы и решения
Angular.js опыт использования, проблемы и решенияOlga Lavrentieva
 
Introduction to AngularJS For WordPress Developers
Introduction to AngularJS For WordPress DevelopersIntroduction to AngularJS For WordPress Developers
Introduction to AngularJS For WordPress DevelopersCaldera Labs
 
One Weekend With AngularJS
One Weekend With AngularJSOne Weekend With AngularJS
One Weekend With AngularJSYashobanta Bai
 
Introduction of angular js
Introduction of angular jsIntroduction of angular js
Introduction of angular jsTamer Solieman
 
Exploring AngularJS - Liju Pillai
Exploring AngularJS - Liju PillaiExploring AngularJS - Liju Pillai
Exploring AngularJS - Liju PillaiLiju Pillai
 

Similar to Angular js - the beginning (20)

Coffee@DBG - Exploring Angular JS
Coffee@DBG - Exploring Angular JSCoffee@DBG - Exploring Angular JS
Coffee@DBG - Exploring Angular JS
 
Angular js
Angular jsAngular js
Angular js
 
Integrating AngularJS into the Campus CMS
Integrating AngularJS into the Campus CMSIntegrating AngularJS into the Campus CMS
Integrating AngularJS into the Campus CMS
 
Angular workshop - Full Development Guide
Angular workshop - Full Development GuideAngular workshop - Full Development Guide
Angular workshop - Full Development Guide
 
Intro to AngularJs
Intro to AngularJsIntro to AngularJs
Intro to AngularJs
 
Angular
AngularAngular
Angular
 
Angular
AngularAngular
Angular
 
AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS Basics
 
Dive into AngularJS and directives
Dive into AngularJS and directivesDive into AngularJS and directives
Dive into AngularJS and directives
 
ANGULAR JS TRAINING IN PUNE
ANGULAR JS TRAINING IN PUNEANGULAR JS TRAINING IN PUNE
ANGULAR JS TRAINING IN PUNE
 
Angular js
Angular jsAngular js
Angular js
 
Angular.js опыт использования, проблемы и решения
Angular.js опыт использования, проблемы и решенияAngular.js опыт использования, проблемы и решения
Angular.js опыт использования, проблемы и решения
 
Angular js
Angular jsAngular js
Angular js
 
Introduction to AngularJS For WordPress Developers
Introduction to AngularJS For WordPress DevelopersIntroduction to AngularJS For WordPress Developers
Introduction to AngularJS For WordPress Developers
 
One Weekend With AngularJS
One Weekend With AngularJSOne Weekend With AngularJS
One Weekend With AngularJS
 
Angular js for Beginnners
Angular js for BeginnnersAngular js for Beginnners
Angular js for Beginnners
 
Angular JS Training Courses
Angular JS Training CoursesAngular JS Training Courses
Angular JS Training Courses
 
Introduction of angular js
Introduction of angular jsIntroduction of angular js
Introduction of angular js
 
Angular Js Basics
Angular Js BasicsAngular Js Basics
Angular Js Basics
 
Exploring AngularJS - Liju Pillai
Exploring AngularJS - Liju PillaiExploring AngularJS - Liju Pillai
Exploring AngularJS - Liju Pillai
 

Recently uploaded

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 

Recently uploaded (20)

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

Angular js - the beginning

  • 2. Outline ● What is Angular ● Why Angular ● How Angular ● Angular world vs JQuery world ● Where to use ● Where not to use ● Why it is special
  • 3. What is Angular HTML enhanced for web apps!
  • 4. What is Angular A Javascript library that allows you to ● EXTEND the functionalities of HTML ● model-view view-model BINDING ● Segregate javascipt logic from HTML rendering ● Provides MVC framework for the messy javascript
  • 5. Why Angular EXTEND the functionalities of HTML HTML <input size="30" type="text" class="richtext"/> Angular way <input size="30" type="richtext"/>
  • 6. Why Angular WHY EXTEND the functionalities of HTML? ● HTML is not enough, we need ○ Rich text ○ Date picker ○ Iterator for dynamic contents ○ etc... ● HTML is build to show static data ○ Angular makes HTML dynamic
  • 7. Why Angular model-view view-model BINDING ● Any changes in javascript model will impact the HTML view ● Any changes in HTML view will impact the javascript model
  • 8. Why Angular model-view view-model BINDING HTML <input size="30" type="text" ng-model="checkIn. start_date"/> Javascript function CheckInsCtrl($scope) { $scope.checkIn = {start_date: '2013-02-13'}; }
  • 9. Why Angular Segregate javascipt logic from HTML rendering Advantage ● Helps to reuse logic as it is not coupled with HTML DOM ● Less coupling with the framework itself, as the library written with plain javascript.
  • 10. How Angular HTML <html> <head> <script src="angular.js"></script> </head> <body ng-app> {{checkIn.rooms_count}} </body> </html> ● Add angular js in the header ● Add ng-app in the body
  • 11. How Angular Javascript function CheckInsCtrl($scope) { $scope.checkIn = {rooms_count: 0}; } ● Define controller and binding data
  • 12. How Angular :: expression Javascript function CheckInsCtrl($scope) { $scope.checkIn = {rooms_count: 0}; } HTML {{checkIn.rooms_count}} ● Use {{}} to represent expression ● Anguler is forgiving for expression evaluation
  • 13. How Angular :: binding HTML <input ng-datepicker type="text" ng-model="checkIn.start_date"/> <input ng-datepicker type="text" ng-model="checkIn.end_date"/> <select ng-model="checkIn.night_counts"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> ... </select> ● Use ng-model to bind with controller data
  • 14. How Angular :: binding Javascript function CheckInsCtrl($scope) { $scope.checkIn = {start_date: '2013-02-16 12:00 AM', end_date: '2013-02-17 12:00 AM', night_counts: 1}; } ● Define model data
  • 15. How Angular :: watching Javascript Observe changes with $watch function CheckInsCtrl($scope) { $scope.checkIn = {start_date: '2013-02-16 12:00 AM', end_date: '2013-02-17 12:00 AM', night_counts: 1}; $scope.$watch('checkIn.start_date + checkIn.end_date', function () { if (isValidMoment($scope.checkIn.start_date) && isValidMoment($scope.checkIn.end_date)) { $scope.updateNightCount(); } }); }
  • 16. Angular world vs JQuery world ● Accessing angular from jquery ● Accessing jquery from angular
  • 17. Accessing angular from jquery Dom generated by angular <div ng-controller="CheckInsCtrl" class="ng-scope"> .... </div> A scope is defined at the root element.
  • 18. Accessing angular from jquery Scope can be accessed as following, var scope = $(elem).scope(); But the elem should have the "ng-scope" class. Which denotes that there is a scope bound with that element.
  • 19. Accessing angular from jquery <div ng-controller="CheckInsCtrl" class="ng-scope"> .... </div> var scope = $($('[ng-controller="CheckInsCtrl"]')[0]). scope(); Root scope is defined at the root element.
  • 20. Accessing jquery from angular Angular can access dom by, ● Angular directives
  • 21. Where to use Angular ● Complex user end UI ○ Where you have a lot of dom event and dom manipulation ● One page application
  • 22. Where not to use Angular ● It is a overkill for simple application where you do not need a lot of client side logic
  • 23. Why it is special ● The target of angular is uniq ● It helps you to extend HTML ○ Add new attribute, element that the browser will understand ● It operates on dom, unlike other libraries that operates on template libraries(String based parsing) ● Can use a plain Javascript Hash for a model object, unlike EmberJs
  • 25. Author A.K.M. Ashrafuzzaman Lead Software Engineer, Tasawr Interactive www.ashrafuzzaman.com zmn.ashraf@gmail.com