SlideShare a Scribd company logo
ANGULARJS
HTML enhanced for web apps!
What is ANGULARJS?
• It’s not a JavaScript library (As they say). There are no
functions which we can directly call and use.
• It is not a DOM manipulation library like jQuery. But it
uses subset of jQuery for DOM manipulation (called
jqLite).
• Focus more on HTML side of web apps.
• For MVC/MVVM design pattern
• AngularJS is a Javascript MVC framework created by
Google to build properly architectured and
maintenable web applications.
Philosophy
“ANGULARJS is what HTML could have been if it had been designed for web application development.”
“”ANGULARJS is built around the philosophy that declarative code is better than imperative code while building
UIs and wiring different components of web application together.”
<!doctype html>
<html ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
</head>
<body>
<div>
<label>Name:</label>
<input type="text" ng-model="yourName" placeholder="Enter a name here">
<hr>
<h1>Hello {{yourName}}!</h1>
</div>
</body>
</html>
Why ANGULARJS?
• Defines numerous ways to organize web application at client side.
• Enhances HTML by attaching directives, custom tags, attributes, expressions, templates within HTML.
• Encourage TDD
• Encourage MVC/MVVM design pattern
• Code Reuse
• Good for Single Page Apps (SPA)
• Cool Features -> Next Slide
Key Features of ANGULARJS
• Declarative HTML approach
• Easy Data Binding : Two way Data Binding
• Reusable Components
• MVC/MVVM Design Pattern
• Dependency Injection
• End to end Integration Testing / Unit Testing
• Routing
• Templating
• Modules
• Services
• Expressions
• Filters
• Directives
• Form Validation
• $scope, $http, $routeProvider…
MVC : Model View Controller
View
ControllerModel
1. Event or User Action
or View Load
2. Maps to particular Model
after fetching the data
3. Implement the
Business Logic on
response data and
Bind it to View
View :
• Renders the Model data
• Send User actions/events to controller
• UI
Controller:
• Define Application Behavior
• Maps user actions to Model
• Select view for response
Model:
• Business Logic
• Notify view changes
• Application Functionality
• Data in general
MVVM: Model View ViewModel
View
ViewModelModel
UI
Presentation LogicBusiness Logic
and Data
• User actions, commands
• Data binding
• Notifications
• Data Access
• Update ViewModel about change
ng-app
Use this directive to auto-bootstrap an application.
Only one ng-app directive can be used per HTML document
<html ng-app>
HTML Compiler
Angular's HTML compiler allows the developer to teach the browser new HTML syntax. The compiler allows
you to attach behavior to any HTML element or attribute and even create new HTML elements or attributes
with custom behavior. Angular calls these behavior extensions directives.
Compiler is an angular service which traverses the DOM looking for attributes. The compilation process
happens in two phases.
Compile: traverse the DOM and collect all of the directives. The result is a linking function.
Link: combine the directives with a scope and produce a live view. Any changes in the scope model are
reflected in the view, and any user interactions with the view are reflected in the scope model. This makes
the scope model the single source of truth.
http://docs.angularjs.org/guide/compiler
Directive
The directives can be placed in element names, attributes, class names, as well as
comments. Directives are a way to teach HTML new tricks.
A directive is just a function which executes when the compiler encounters it in the DOM.
<input ng-model='name'>
Custom Defined Directives
<span draggable>Drag ME</span>
Expression
Expressions are JavaScript-like code snippets that are usually placed in bindings such as {{
expression }}
<body>
1+2={{1+2}}
</body>
Forms
Form and controls provide validation services, so that the user can be notified of invalid
input. This provides a better user experience, because the user gets instant feedback on
how to correct the error.
<input type="text" ng-model="user.name" name="uName" required />
<button ng-click="update(user)“ ng-disabled="form.$invalid ||
isUnchanged(user)">SAVE</button>
Module
Modules declaratively specify how an application should be bootstrapped.
There can be multiple modules in an app
Those could be interdependent too.
// declare a module
var myAppModule = angular.module('myApp', [--here goes the dependent Modules--]);
Modules are configured with routes, controllers, models etc.
Routing
It Is used for deep-linking URLs to controllers and views (HTML partials). It watches $location.url() and
tries to map the path to an existing route definition.
$routeProvider.when('/Book', {
template: 'examples/book.html',
controller: BookCntl,
});
$routeProvider.when('/Book/chapter01', {
template: 'examples/chapter01.html',
controller: ChapterCntl,
});
Scope
Scope is an object that refers to the application model.
It is an execution context for expressions.
Scopes are arranged in hierarchical structure which mimic the DOM structure of the
application.
Scopes can watch expressions and propagate events.
Actually the ViewModel of MVVM.
$scope
Dependency Injection
Dependency Injection (DI) is a software design pattern that deals with how code gets hold
of its dependencies.
Filters
Angular filters format data for display to the user.
{{ expression [| filter_name[:parameter_value] ... ] }}
{{ uppercase_expression | uppercase }}
{{ expression | filter1 | filter2 }}
Can create custom filters
Resources
Documentation
• AngularJS Developer Guide
• AngularJS API
• AngularJS Tutorial
Videos
• AngularJS Fundamentals In 60-ish Minutes
• Introduction to Angular JS
• AngularJS end-to-end web app tutorial Part I
Introduction to Angularjs : kishan kumar

More Related Content

PDF
Introduction to Angular Js
PPTX
AngularJs (1.x) Presentation
PPTX
Angular js 1.3 presentation for fed nov 2014
PPTX
Angular js presentation at Datacom
PDF
AngularJS - introduction & how it works?
PDF
Introduction of angular js
PDF
Angular Project Report
PPTX
Introduction to AngularJS
Introduction to Angular Js
AngularJs (1.x) Presentation
Angular js 1.3 presentation for fed nov 2014
Angular js presentation at Datacom
AngularJS - introduction & how it works?
Introduction of angular js
Angular Project Report
Introduction to AngularJS

What's hot (20)

PPTX
Introduction to single page application with angular js
PDF
AngularJS: Overview & Key Features
PDF
Angular js
PPTX
Angular js
PPT
ASP .net MVC
PPTX
MVVM In Use
ODP
What is MVC?
PPTX
Angularjs PPT
PDF
MVC architecture
PPTX
ASP.NET MVC Presentation
PPTX
Introduction to AngularJS Framework
PPTX
Mvc pattern and implementation in java fair
PPT
MVC Architecture
PPT
Asp.net mvc
PPTX
ASP .NET MVC Introduction & Guidelines
PPTX
Angular js
PDF
MVC Seminar Presantation
PPTX
Intoduction to Angularjs
PPT
Why MVC?
Introduction to single page application with angular js
AngularJS: Overview & Key Features
Angular js
Angular js
ASP .net MVC
MVVM In Use
What is MVC?
Angularjs PPT
MVC architecture
ASP.NET MVC Presentation
Introduction to AngularJS Framework
Mvc pattern and implementation in java fair
MVC Architecture
Asp.net mvc
ASP .NET MVC Introduction & Guidelines
Angular js
MVC Seminar Presantation
Intoduction to Angularjs
Why MVC?
Ad

Similar to Introduction to Angularjs : kishan kumar (20)

PPTX
Angularjs
PDF
One Weekend With AngularJS
PPTX
Angular workshop - Full Development Guide
PPTX
Introduction to AngularJs
PPTX
ME vs WEB - AngularJS Fundamentals
PPTX
Angular JS - Introduction
PDF
Everything You Need To Know About AngularJS
PDF
Wt unit 5 client &amp; server side framework
PDF
AngularJs
PDF
Angularjs 131211063348-phpapp01
PPTX
AngularJS is awesome
PPTX
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
PPTX
Angular JS, A dive to concepts
PPTX
Learning AngularJS - Complete coverage of AngularJS features and concepts
PPTX
Training On Angular Js
PPTX
Angularjs basic part01
PDF
Getting Started With AngularJS
PPT
Angular js
PPTX
Single Page Applications Workshop Part II: Single Page Applications using Ang...
Angularjs
One Weekend With AngularJS
Angular workshop - Full Development Guide
Introduction to AngularJs
ME vs WEB - AngularJS Fundamentals
Angular JS - Introduction
Everything You Need To Know About AngularJS
Wt unit 5 client &amp; server side framework
AngularJs
Angularjs 131211063348-phpapp01
AngularJS is awesome
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
Angular JS, A dive to concepts
Learning AngularJS - Complete coverage of AngularJS features and concepts
Training On Angular Js
Angularjs basic part01
Getting Started With AngularJS
Angular js
Single Page Applications Workshop Part II: Single Page Applications using Ang...
Ad

Recently uploaded (20)

PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Electronic commerce courselecture one. Pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPT
Teaching material agriculture food technology
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
cuic standard and advanced reporting.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Encapsulation theory and applications.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
Understanding_Digital_Forensics_Presentation.pptx
Electronic commerce courselecture one. Pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Teaching material agriculture food technology
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Review of recent advances in non-invasive hemoglobin estimation
Spectral efficient network and resource selection model in 5G networks
Agricultural_Statistics_at_a_Glance_2022_0.pdf
The AUB Centre for AI in Media Proposal.docx
cuic standard and advanced reporting.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Network Security Unit 5.pdf for BCA BBA.
Chapter 3 Spatial Domain Image Processing.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Building Integrated photovoltaic BIPV_UPV.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Encapsulation theory and applications.pdf
MYSQL Presentation for SQL database connectivity
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
“AI and Expert System Decision Support & Business Intelligence Systems”

Introduction to Angularjs : kishan kumar

  • 2. What is ANGULARJS? • It’s not a JavaScript library (As they say). There are no functions which we can directly call and use. • It is not a DOM manipulation library like jQuery. But it uses subset of jQuery for DOM manipulation (called jqLite). • Focus more on HTML side of web apps. • For MVC/MVVM design pattern • AngularJS is a Javascript MVC framework created by Google to build properly architectured and maintenable web applications.
  • 3. Philosophy “ANGULARJS is what HTML could have been if it had been designed for web application development.” “”ANGULARJS is built around the philosophy that declarative code is better than imperative code while building UIs and wiring different components of web application together.” <!doctype html> <html ng-app> <head> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script> </head> <body> <div> <label>Name:</label> <input type="text" ng-model="yourName" placeholder="Enter a name here"> <hr> <h1>Hello {{yourName}}!</h1> </div> </body> </html>
  • 4. Why ANGULARJS? • Defines numerous ways to organize web application at client side. • Enhances HTML by attaching directives, custom tags, attributes, expressions, templates within HTML. • Encourage TDD • Encourage MVC/MVVM design pattern • Code Reuse • Good for Single Page Apps (SPA) • Cool Features -> Next Slide
  • 5. Key Features of ANGULARJS • Declarative HTML approach • Easy Data Binding : Two way Data Binding • Reusable Components • MVC/MVVM Design Pattern • Dependency Injection • End to end Integration Testing / Unit Testing • Routing • Templating • Modules • Services • Expressions • Filters • Directives • Form Validation • $scope, $http, $routeProvider…
  • 6. MVC : Model View Controller View ControllerModel 1. Event or User Action or View Load 2. Maps to particular Model after fetching the data 3. Implement the Business Logic on response data and Bind it to View View : • Renders the Model data • Send User actions/events to controller • UI Controller: • Define Application Behavior • Maps user actions to Model • Select view for response Model: • Business Logic • Notify view changes • Application Functionality • Data in general
  • 7. MVVM: Model View ViewModel View ViewModelModel UI Presentation LogicBusiness Logic and Data • User actions, commands • Data binding • Notifications • Data Access • Update ViewModel about change
  • 8. ng-app Use this directive to auto-bootstrap an application. Only one ng-app directive can be used per HTML document <html ng-app>
  • 9. HTML Compiler Angular's HTML compiler allows the developer to teach the browser new HTML syntax. The compiler allows you to attach behavior to any HTML element or attribute and even create new HTML elements or attributes with custom behavior. Angular calls these behavior extensions directives. Compiler is an angular service which traverses the DOM looking for attributes. The compilation process happens in two phases. Compile: traverse the DOM and collect all of the directives. The result is a linking function. Link: combine the directives with a scope and produce a live view. Any changes in the scope model are reflected in the view, and any user interactions with the view are reflected in the scope model. This makes the scope model the single source of truth. http://docs.angularjs.org/guide/compiler
  • 10. Directive The directives can be placed in element names, attributes, class names, as well as comments. Directives are a way to teach HTML new tricks. A directive is just a function which executes when the compiler encounters it in the DOM. <input ng-model='name'> Custom Defined Directives <span draggable>Drag ME</span>
  • 11. Expression Expressions are JavaScript-like code snippets that are usually placed in bindings such as {{ expression }} <body> 1+2={{1+2}} </body>
  • 12. Forms Form and controls provide validation services, so that the user can be notified of invalid input. This provides a better user experience, because the user gets instant feedback on how to correct the error. <input type="text" ng-model="user.name" name="uName" required /> <button ng-click="update(user)“ ng-disabled="form.$invalid || isUnchanged(user)">SAVE</button>
  • 13. Module Modules declaratively specify how an application should be bootstrapped. There can be multiple modules in an app Those could be interdependent too. // declare a module var myAppModule = angular.module('myApp', [--here goes the dependent Modules--]); Modules are configured with routes, controllers, models etc.
  • 14. Routing It Is used for deep-linking URLs to controllers and views (HTML partials). It watches $location.url() and tries to map the path to an existing route definition. $routeProvider.when('/Book', { template: 'examples/book.html', controller: BookCntl, }); $routeProvider.when('/Book/chapter01', { template: 'examples/chapter01.html', controller: ChapterCntl, });
  • 15. Scope Scope is an object that refers to the application model. It is an execution context for expressions. Scopes are arranged in hierarchical structure which mimic the DOM structure of the application. Scopes can watch expressions and propagate events. Actually the ViewModel of MVVM. $scope
  • 16. Dependency Injection Dependency Injection (DI) is a software design pattern that deals with how code gets hold of its dependencies.
  • 17. Filters Angular filters format data for display to the user. {{ expression [| filter_name[:parameter_value] ... ] }} {{ uppercase_expression | uppercase }} {{ expression | filter1 | filter2 }} Can create custom filters
  • 18. Resources Documentation • AngularJS Developer Guide • AngularJS API • AngularJS Tutorial Videos • AngularJS Fundamentals In 60-ish Minutes • Introduction to Angular JS • AngularJS end-to-end web app tutorial Part I