SlideShare a Scribd company logo
1 of 21
Sabin Tamrakar
sabintmkr09@outlook.com
WHAT IS ANGULARJS ?
• It is not JavaScript library.
• There are no functions we can call and use directly.
• It is not a DOM like jQuery. But uses subset of jQuery (jqLite).
• Focuses more on HTML side of webpages.
• For MVC/MVVM design pattern.
• Thus, AngularJS is a JavaScript MVC framework created by Google to build properly
architecture and maintainable web application.
HISTORY
• AngularJS version 1.0 was released in 2012.
• Miško Hevery, a Google employee, started to work with AngularJS in 2009.
• The idea turned out very well, and the project is now officially supported by Google.
• AngularJS is distributed as a JavaScript file, and can be added to a web page with a
script tag:
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
WHY ANGULARJS ?
• Defines ways to organize web application at client side.
• Extends HTML with new attributes, custom tags, expressions, templates with html.
• Good for Single Page Application (SPA) .
• Encourages MV/MVVM design patterns.
BEFORE ANGULARJS
KEY FEATURES
Features
DATA BINDING
MODEL AND VIEW
MODEL
• Plain old Java(Script) Objects (POJO) is used.
• No need to extend hierarchy.
VIEW
• Just plain HTML.
• Built in directives similar to JSTL.
CONTROLLER
• AngularJS controllers control the data of AngularJS applications.
• AngularJS controllers are regular JavaScript Objects.
• Controller can have methods too.
• The ng-controller directive defines the application controller.
• It’s a plain old javascript function
//declare Controller:
<div ng-app=“myApp” ng-controller=“myCtrl”>
• The ng-app directive tells AngularJS that the <div> element is the "owner" of an
AngularJS application.
• Use this directive to auto-bootstrap an application.
• Only one ng-app directive can be used per html document.
//Declare ng-app
<html ng-app>
ng-app
• AngularJS lets you extend HTML with new attributes called Directives.
• The directives can be placed in elements name, attributes, class names as well as
comments.
• Directives are ways to teach html new tricks.
• A directive is just a function that executes when compiler encounters it in the DOM
//Declare Directives:
<input ng-model=‘name’>
Directives
• The ng-app directive initializes an AngularJS application.
• The ng-init directive initializes application data.
• The ng-model directive binds the value of HTML controls (input, select, text-area) to
application data.
<div ng-app=“” ng-init=“firstName='John‘ “>
<p>Name: <input type="text" ng-model="firstName"></p>
<p>You wrote: {{ firstName }}</p>
</div>
Example
EXPRESSION
• AngularJS expressions are written inside double braces: {{ expression }}.
• AngularJS expressions binds data to HTML the same way as the ng-bind directive.
• AngularJS will "output" data exactly where the expression is written.
• AngularJS expressions are much like JavaScript expressions: They can contain
literals, operators, and variables.
• Example {{ 5 + 5 }} or {{ firstName + " " + lastName }}
FORMS
• An AngularJS form is a collection of input controls.
• It provides validation services, so that the users can be notified of invalid inputs.
• It provides instance feedback.
MODULE
• An AngularJS module defines an application.
• A module is a container for the different parts of an application.
• All application controllers should belong to a module.
• There can be multiple module.
//declare module:
var myAppModule=angular.module(‘myApp’,[--here goes dependent modules--]);
SCOPE
• An object that refers to application itself (model).
• An execution context for expressions like {{todo.name}}.
• Scope are arranged in hierarchical structure that mimics the DOM structure of the
application.
• Scope can watch expressions and propagate events.
//declare Scope:
$Scope
DEPENDENCY INJECTION
• Dependency Injection is a software design pattern that deals with how the
codes gets hold of its dependency.
• Testing is easy.
• Its SOLID (oop principle/design pattern)
FILTERS
• AngularJS filters format data for display for the users.
• Can create custom filters.
//Declare Filters:
{{expression [|filter_name[:parameter_value]..]}}
{{uppercase_expression | uppercase}}
{{expression |filter1|filter2}}
SERVICES
• Provides cleaner code.
• Organizable and reusability.
• Shared business logic.
• Data retrieval.
• One instance in app.
Angularjs

More Related Content

What's hot

Overview of the AngularJS framework
Overview of the AngularJS framework Overview of the AngularJS framework
Overview of the AngularJS framework Yakov Fain
 
AngularJS: Overview & Key Features
AngularJS: Overview & Key FeaturesAngularJS: Overview & Key Features
AngularJS: Overview & Key FeaturesMohamad Al Asmar
 
AngularJS - What is it & Why is it awesome ? (with demos)
AngularJS - What is it & Why is it awesome ? (with demos)AngularJS - What is it & Why is it awesome ? (with demos)
AngularJS - What is it & Why is it awesome ? (with demos)Gary Arora
 
Introduction of angular js
Introduction of angular jsIntroduction of angular js
Introduction of angular jsTamer Solieman
 
AngularJS best-practices
AngularJS best-practicesAngularJS best-practices
AngularJS best-practicesHenry Tao
 
AngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get startedAngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get startedStéphane Bégaudeau
 
The Basics Angular JS
The Basics Angular JS The Basics Angular JS
The Basics Angular JS OrisysIndia
 
Why angular js Framework
Why angular js Framework Why angular js Framework
Why angular js Framework Sakthi Bro
 
Introduction to Angular js 2.0
Introduction to Angular js 2.0Introduction to Angular js 2.0
Introduction to Angular js 2.0Nagaraju Sangam
 
AngularJs presentation
AngularJs presentation AngularJs presentation
AngularJs presentation Phan Tuan
 
AngularJS introduction
AngularJS introductionAngularJS introduction
AngularJS introductionTania Gonzales
 
Angular js
Angular jsAngular js
Angular jsMindtree
 

What's hot (20)

Angular js
Angular jsAngular js
Angular js
 
Introduction to Angular JS
Introduction to Angular JSIntroduction to Angular JS
Introduction to Angular JS
 
Angular js
Angular jsAngular js
Angular js
 
Overview of the AngularJS framework
Overview of the AngularJS framework Overview of the AngularJS framework
Overview of the AngularJS framework
 
AngularJS: Overview & Key Features
AngularJS: Overview & Key FeaturesAngularJS: Overview & Key Features
AngularJS: Overview & Key Features
 
AngularJS - What is it & Why is it awesome ? (with demos)
AngularJS - What is it & Why is it awesome ? (with demos)AngularJS - What is it & Why is it awesome ? (with demos)
AngularJS - What is it & Why is it awesome ? (with demos)
 
Introduction of angular js
Introduction of angular jsIntroduction of angular js
Introduction of angular js
 
AngularJS
AngularJSAngularJS
AngularJS
 
Angular js
Angular jsAngular js
Angular js
 
AngularJS best-practices
AngularJS best-practicesAngularJS best-practices
AngularJS best-practices
 
AngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get startedAngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get started
 
The Basics Angular JS
The Basics Angular JS The Basics Angular JS
The Basics Angular JS
 
Why angular js Framework
Why angular js Framework Why angular js Framework
Why angular js Framework
 
Introduction to Angular js 2.0
Introduction to Angular js 2.0Introduction to Angular js 2.0
Introduction to Angular js 2.0
 
Angularjs basic part01
Angularjs basic part01Angularjs basic part01
Angularjs basic part01
 
AngularJs presentation
AngularJs presentation AngularJs presentation
AngularJs presentation
 
AngularJS introduction
AngularJS introductionAngularJS introduction
AngularJS introduction
 
Angular js
Angular jsAngular js
Angular js
 
Angular 4
Angular 4Angular 4
Angular 4
 
Angularjs
AngularjsAngularjs
Angularjs
 

Viewers also liked (12)

Trabajo nº 9
Trabajo nº 9Trabajo nº 9
Trabajo nº 9
 
Micro
MicroMicro
Micro
 
Lectura 3
Lectura 3Lectura 3
Lectura 3
 
Acta de finiquito
Acta de finiquitoActa de finiquito
Acta de finiquito
 
Micro
MicroMicro
Micro
 
Trabajo nº 8
Trabajo nº 8Trabajo nº 8
Trabajo nº 8
 
Base de datos
Base de datosBase de datos
Base de datos
 
An Introduction to Precision Growth Strategies
An Introduction to Precision Growth StrategiesAn Introduction to Precision Growth Strategies
An Introduction to Precision Growth Strategies
 
VINDUSPUSS
VINDUSPUSSVINDUSPUSS
VINDUSPUSS
 
Management Information System
Management Information SystemManagement Information System
Management Information System
 
Access
AccessAccess
Access
 
Obligaciones del empleador con el trabajador
Obligaciones del empleador con el trabajadorObligaciones del empleador con el trabajador
Obligaciones del empleador con el trabajador
 

Similar to Angularjs

Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to AngularjsGaurav Agrawal
 
AgularJS basics- angular directives and controllers
AgularJS basics- angular directives and controllersAgularJS basics- angular directives and controllers
AgularJS basics- angular directives and controllersjobinThomas54
 
Angularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetupAngularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetupGoutam Dey
 
AngularJs (1.x) Presentation
AngularJs (1.x) PresentationAngularJs (1.x) Presentation
AngularJs (1.x) PresentationRaghubir Singh
 
Angular JS Indtrodution
Angular JS IndtrodutionAngular JS Indtrodution
Angular JS Indtrodutionadesh21
 
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 conceptsSuresh Patidar
 
Introduction to Angularjs : kishan kumar
Introduction to Angularjs : kishan kumarIntroduction to Angularjs : kishan kumar
Introduction to Angularjs : kishan kumarAppfinz Technologies
 
Kalp Corporate Angular Js Tutorials
Kalp Corporate Angular Js TutorialsKalp Corporate Angular Js Tutorials
Kalp Corporate Angular Js TutorialsKalp Corporate
 
AngularJS Beginners Workshop
AngularJS Beginners WorkshopAngularJS Beginners Workshop
AngularJS Beginners WorkshopSathish VJ
 
Valentine with Angular js - Introduction
Valentine with Angular js - IntroductionValentine with Angular js - Introduction
Valentine with Angular js - IntroductionSenthil Kumar
 
Angular JS, A dive to concepts
Angular JS, A dive to conceptsAngular JS, A dive to concepts
Angular JS, A dive to conceptsAbhishek Sur
 
Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - IntroductionSagar Acharya
 
When to use and when not to use AngularJS - Liju Pillai, www.perfomatix.com
When to use and when not to use AngularJS - Liju Pillai, www.perfomatix.comWhen to use and when not to use AngularJS - Liju Pillai, www.perfomatix.com
When to use and when not to use AngularJS - Liju Pillai, www.perfomatix.comPerfomatix Solutions
 

Similar to Angularjs (20)

Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to Angularjs
 
AgularJS basics- angular directives and controllers
AgularJS basics- angular directives and controllersAgularJS basics- angular directives and controllers
AgularJS basics- angular directives and controllers
 
Angularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetupAngularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetup
 
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
 
Anjular js
Anjular jsAnjular js
Anjular js
 
AngularJS is awesome
AngularJS is awesomeAngularJS is awesome
AngularJS is awesome
 
Introduction to Angular Js
Introduction to Angular JsIntroduction to Angular Js
Introduction to Angular Js
 
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
 
Introduction to Angularjs : kishan kumar
Introduction to Angularjs : kishan kumarIntroduction to Angularjs : kishan kumar
Introduction to Angularjs : kishan kumar
 
Introduction to Angularjs
Introduction to AngularjsIntroduction to Angularjs
Introduction to Angularjs
 
Kalp Corporate Angular Js Tutorials
Kalp Corporate Angular Js TutorialsKalp Corporate Angular Js Tutorials
Kalp Corporate Angular Js Tutorials
 
AngularJS Beginners Workshop
AngularJS Beginners WorkshopAngularJS Beginners Workshop
AngularJS Beginners Workshop
 
Angular js for Beginnners
Angular js for BeginnnersAngular js for Beginnners
Angular js for Beginnners
 
Valentine with Angular js - Introduction
Valentine with Angular js - IntroductionValentine with Angular js - Introduction
Valentine with Angular js - Introduction
 
Angular JS, A dive to concepts
Angular JS, A dive to conceptsAngular JS, A dive to concepts
Angular JS, A dive to concepts
 
Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - Introduction
 
Introduction to Angular Js
Introduction to Angular JsIntroduction to Angular Js
Introduction to Angular Js
 
Wt unit 5 client &amp; server side framework
Wt unit 5 client &amp; server side frameworkWt unit 5 client &amp; server side framework
Wt unit 5 client &amp; server side framework
 
When to use and when not to use AngularJS - Liju Pillai, www.perfomatix.com
When to use and when not to use AngularJS - Liju Pillai, www.perfomatix.comWhen to use and when not to use AngularJS - Liju Pillai, www.perfomatix.com
When to use and when not to use AngularJS - Liju Pillai, www.perfomatix.com
 

Recently uploaded

WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2
 
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdfAzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdfryanfarris8
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...WSO2
 
Evolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI EraEvolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI Eraconfluent
 
WSO2CON 2024 - Software Engineering for Digital Businesses
WSO2CON 2024 - Software Engineering for Digital BusinessesWSO2CON 2024 - Software Engineering for Digital Businesses
WSO2CON 2024 - Software Engineering for Digital BusinessesWSO2
 
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of Transformation
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of TransformationWSO2CON 2024 - Designing Event-Driven Enterprises: Stories of Transformation
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of TransformationWSO2
 
WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!
WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!
WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!WSO2
 
WSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration ToolingWSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration ToolingWSO2
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
WSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next IntegrationWSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next IntegrationWSO2
 
WSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid EnvironmentsWSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid EnvironmentsWSO2
 
WSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2
 
Driving Innovation: Scania's API Revolution with WSO2
Driving Innovation: Scania's API Revolution with WSO2Driving Innovation: Scania's API Revolution with WSO2
Driving Innovation: Scania's API Revolution with WSO2WSO2
 

Recently uploaded (20)

WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdfAzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...
 
Evolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI EraEvolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI Era
 
WSO2CON 2024 - Software Engineering for Digital Businesses
WSO2CON 2024 - Software Engineering for Digital BusinessesWSO2CON 2024 - Software Engineering for Digital Businesses
WSO2CON 2024 - Software Engineering for Digital Businesses
 
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of Transformation
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of TransformationWSO2CON 2024 - Designing Event-Driven Enterprises: Stories of Transformation
WSO2CON 2024 - Designing Event-Driven Enterprises: Stories of Transformation
 
WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!
WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!
WSO2CON 2024 - Not Just Microservices: Rightsize Your Services!
 
WSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration ToolingWSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration Tooling
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
WSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next IntegrationWSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
 
WSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid EnvironmentsWSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid Environments
 
WSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AI
 
Driving Innovation: Scania's API Revolution with WSO2
Driving Innovation: Scania's API Revolution with WSO2Driving Innovation: Scania's API Revolution with WSO2
Driving Innovation: Scania's API Revolution with WSO2
 

Angularjs

  • 2. WHAT IS ANGULARJS ? • It is not JavaScript library. • There are no functions we can call and use directly. • It is not a DOM like jQuery. But uses subset of jQuery (jqLite). • Focuses more on HTML side of webpages. • For MVC/MVVM design pattern. • Thus, AngularJS is a JavaScript MVC framework created by Google to build properly architecture and maintainable web application.
  • 3. HISTORY • AngularJS version 1.0 was released in 2012. • Miško Hevery, a Google employee, started to work with AngularJS in 2009. • The idea turned out very well, and the project is now officially supported by Google. • AngularJS is distributed as a JavaScript file, and can be added to a web page with a script tag: <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
  • 4. WHY ANGULARJS ? • Defines ways to organize web application at client side. • Extends HTML with new attributes, custom tags, expressions, templates with html. • Good for Single Page Application (SPA) . • Encourages MV/MVVM design patterns.
  • 9. MODEL AND VIEW MODEL • Plain old Java(Script) Objects (POJO) is used. • No need to extend hierarchy. VIEW • Just plain HTML. • Built in directives similar to JSTL.
  • 10. CONTROLLER • AngularJS controllers control the data of AngularJS applications. • AngularJS controllers are regular JavaScript Objects. • Controller can have methods too. • The ng-controller directive defines the application controller. • It’s a plain old javascript function //declare Controller: <div ng-app=“myApp” ng-controller=“myCtrl”>
  • 11. • The ng-app directive tells AngularJS that the <div> element is the "owner" of an AngularJS application. • Use this directive to auto-bootstrap an application. • Only one ng-app directive can be used per html document. //Declare ng-app <html ng-app> ng-app
  • 12. • AngularJS lets you extend HTML with new attributes called Directives. • The directives can be placed in elements name, attributes, class names as well as comments. • Directives are ways to teach html new tricks. • A directive is just a function that executes when compiler encounters it in the DOM //Declare Directives: <input ng-model=‘name’> Directives
  • 13. • The ng-app directive initializes an AngularJS application. • The ng-init directive initializes application data. • The ng-model directive binds the value of HTML controls (input, select, text-area) to application data. <div ng-app=“” ng-init=“firstName='John‘ “> <p>Name: <input type="text" ng-model="firstName"></p> <p>You wrote: {{ firstName }}</p> </div> Example
  • 14. EXPRESSION • AngularJS expressions are written inside double braces: {{ expression }}. • AngularJS expressions binds data to HTML the same way as the ng-bind directive. • AngularJS will "output" data exactly where the expression is written. • AngularJS expressions are much like JavaScript expressions: They can contain literals, operators, and variables. • Example {{ 5 + 5 }} or {{ firstName + " " + lastName }}
  • 15. FORMS • An AngularJS form is a collection of input controls. • It provides validation services, so that the users can be notified of invalid inputs. • It provides instance feedback.
  • 16. MODULE • An AngularJS module defines an application. • A module is a container for the different parts of an application. • All application controllers should belong to a module. • There can be multiple module. //declare module: var myAppModule=angular.module(‘myApp’,[--here goes dependent modules--]);
  • 17. SCOPE • An object that refers to application itself (model). • An execution context for expressions like {{todo.name}}. • Scope are arranged in hierarchical structure that mimics the DOM structure of the application. • Scope can watch expressions and propagate events. //declare Scope: $Scope
  • 18. DEPENDENCY INJECTION • Dependency Injection is a software design pattern that deals with how the codes gets hold of its dependency. • Testing is easy. • Its SOLID (oop principle/design pattern)
  • 19. FILTERS • AngularJS filters format data for display for the users. • Can create custom filters. //Declare Filters: {{expression [|filter_name[:parameter_value]..]}} {{uppercase_expression | uppercase}} {{expression |filter1|filter2}}
  • 20. SERVICES • Provides cleaner code. • Organizable and reusability. • Shared business logic. • Data retrieval. • One instance in app.