SlideShare a Scribd company logo
Slides Assembled by:
Hritesh
What is AngularJS?
 A JavaScript framework for creating
dynamic web applications
 Open Source
• GitHub: https://github.com/angular/angular.js
• MIT License
 Uses jQuery
• jQuery 1.7.1 or above
• jQLite
MVC
 Model
• The data
 Controller
• The behavior
• Modifying / updating the models
 View
• The interface
• How the data is presented to the user
JavaScript
HTML
Data Binding
 Views are declarative
• The structure of the interface
 Controllers do not need to directly
manipulate the view
• Changes in the models / data are
automatically reflected in the view
• Updates are managed by the frameworks
Sample Application
 GitHub:
• https://github.com/christophertfoo/AngularSample
Views
 Make use of special ng attributes (directives) on the
HTML elements
• ng-app
• Determines which part of the page will use AngularJS
• If given a value it will load that application module
• ng-controller
• Determines which Javascript Controller should be used for that
part of the page
• ng-model
• Determines what model the value of an input field will be
bound to
• Used for two-way binding
Views
 More ng directives
• ng-if=“<model expression>”
• Inserts HTML element if expression is true
• Does not insert element in the DOM if it is false
• ng-repeat=“<variable> in <array>”
• Repeats the HTML element for each value in the
array
• Also a key-value pair version for JSON objects
• “(<key>, <value>) in <JSON>”
Views
 {{ }}
• Angular expressions
• Like JavaScript expressions except:
• Evaluated in the current scope (see Controllers later
on), not the global window
• More forgiving to undefined and null errors
• No control statements: conditionals, loops, or throw
• Insert model values directly into the view
Controller
 Function that takes at least one parameter: $scope
• Function is a constructor
• Ex:
• function MyCtrl($scope) { … }
• We will see a different way of creating a controller
constructor later
 $scope
• JavaScript object
• Contains data (i.e. models) and methods (i.e. functions)
• Can add own properties
• $scope.<my new property> = <value>;
Controller
 Dependency Injection
• Pass the modules and services that you need as
parameters
• In the previous case $scope is a service that will be
injected
• Can be passed as an array of strings to the controller
function as well
• Prevents errors when performing minification
• Other useful services
• $http
• Used to handle Ajax calls
• Wrappers around jQuery
Controller
 Typically also contains module loading
 angular.module(<name>, [<dependencies>]);
• Creates a module with the given name
• This module can then be configured
• Ex.
• var myApp = angular.module(‘myApp’, []);
myApp.controller(‘MyCtrl’, function($scope) { … });
myApp.controller(‘OtherCtrl’, [‘$scope’, ‘$http’,
function($scope, $http) { … }]);
Models
 Properties on the Controller’s $scope
object
 Standard JavaScript values
Modules
 Can be used to separate the application
into parts
 Application module can include the other
modules by listing them as
dependencies
Modules
var myControllers =
angular.module(‘myControllers’, []);
// Add controllers to the module
myControllers.controller(…);
var myApp = angular.module(‘myApp’,
[‘myControllers’]);
More
 You can do a lot more with AngularJS
• Custom directives
• http://docs.angularjs.org/guide/directive
• Filters
• http://
docs.angularjs.org/guide/dev_guide.templates.filters
 To learn more:
• Tutorial: http://docs.angularjs.org/tutorial
• Documentation: http://docs.angularjs.org
/guide/overview
Thank you for listening!
 Questions / Comments?
Routing
 Use different views for different URL
fragments
 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
Routing
 Enable by injecting the $routeProvider
• myApp = angular.module(‘myApp’, [‘ngRoute’]);
myApp.config([‘$routeProvider’, function($routeProvider) { … }]);
 $routeProvider.when(<path>, {<route>});
• Defines a new route that uses the given path
• The path may have parameters
• Parameters start with a colon (‘:’)
• Ex
• ‘/user/:userId’
• Typical route fields:
• controller = The name of the controller that should be used
• templateUrl = A path to the template partial that should be used
 $routeProvider.otherwise({<route>});
• Typical route fields:
• redirectTo: ‘<path>’
 API: http://docs.angularjs.org/api/ngRoute.$routeProvider
Routing
 URL parameters
• To access the parameters in the URL, use the
$routeParams service
• The $routeParams object will have a field with
the same name as the parameter
• Ex.
• $routeParams.userId
Routing
 Paths default to Hashbang mode
• Example URL.
• http://www.mysite.com/#/users
 Can use HTML 5 mode by configuring the
$locationProvider
• Ex.
• // Inject $locationProvider into the module using config
$locationProvider.html5Mode(true);
• Example URL:
• http://www.mysite.com/users

More Related Content

What's hot

Angular js presentation at Datacom
Angular js presentation at DatacomAngular js presentation at Datacom
Angular js presentation at Datacom
David Xi Peng Yang
 
AngularJS Best Practices
AngularJS Best PracticesAngularJS Best Practices
AngularJS Best Practices
Narek Mamikonyan
 
Angularjs
AngularjsAngularjs
Angularjs
Sabin Tamrakar
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
Jussi Pohjolainen
 
Valentine with Angular js - Introduction
Valentine with Angular js - IntroductionValentine with Angular js - Introduction
Valentine with Angular js - Introduction
Senthil Kumar
 
AngularJS intro
AngularJS introAngularJS intro
AngularJS intro
dizabl
 
Angularjs Basics
Angularjs BasicsAngularjs Basics
Angularjs Basics
Jayantha Sirisena
 
AngularJs (1.x) Presentation
AngularJs (1.x) PresentationAngularJs (1.x) Presentation
AngularJs (1.x) Presentation
Raghubir Singh
 
Introduction to Angular JS
Introduction to Angular JSIntroduction to Angular JS
Introduction to Angular JS
Santhosh Kumar Srinivasan
 
Angularjs architecture
Angularjs architectureAngularjs architecture
Angularjs architecture
Michael He
 
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
 
Single Page Applications in SharePoint with Angular
Single Page Applications in SharePoint with AngularSingle Page Applications in SharePoint with Angular
Single Page Applications in SharePoint with Angular
Sparkhound Inc.
 
Angular js for beginners
Angular js for beginnersAngular js for beginners
Angular js for beginners
Munir Hoque
 
Angular js for Beginnners
Angular js for BeginnnersAngular js for Beginnners
Angular js for Beginnners
Santosh Kumar Kar
 
Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - Introduction
Sagar Acharya
 
Mini-Training: AngularJS
Mini-Training: AngularJSMini-Training: AngularJS
Mini-Training: AngularJS
Betclic Everest Group Tech Team
 
Angular JS tutorial
Angular JS tutorialAngular JS tutorial
Angular JS tutorial
cncwebworld
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
David Parsons
 
AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS Basics
Nikita Shounewich
 
SPA, Scalable Application & AngularJS
SPA, Scalable Application & AngularJSSPA, Scalable Application & AngularJS
SPA, Scalable Application & AngularJS
Mitch Chen
 

What's hot (20)

Angular js presentation at Datacom
Angular js presentation at DatacomAngular js presentation at Datacom
Angular js presentation at Datacom
 
AngularJS Best Practices
AngularJS Best PracticesAngularJS Best Practices
AngularJS Best Practices
 
Angularjs
AngularjsAngularjs
Angularjs
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Valentine with Angular js - Introduction
Valentine with Angular js - IntroductionValentine with Angular js - Introduction
Valentine with Angular js - Introduction
 
AngularJS intro
AngularJS introAngularJS intro
AngularJS intro
 
Angularjs Basics
Angularjs BasicsAngularjs Basics
Angularjs Basics
 
AngularJs (1.x) Presentation
AngularJs (1.x) PresentationAngularJs (1.x) Presentation
AngularJs (1.x) Presentation
 
Introduction to Angular JS
Introduction to Angular JSIntroduction to Angular JS
Introduction to Angular JS
 
Angularjs architecture
Angularjs architectureAngularjs architecture
Angularjs architecture
 
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)
 
Single Page Applications in SharePoint with Angular
Single Page Applications in SharePoint with AngularSingle Page Applications in SharePoint with Angular
Single Page Applications in SharePoint with Angular
 
Angular js for beginners
Angular js for beginnersAngular js for beginners
Angular js for beginners
 
Angular js for Beginnners
Angular js for BeginnnersAngular js for Beginnners
Angular js for Beginnners
 
Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - Introduction
 
Mini-Training: AngularJS
Mini-Training: AngularJSMini-Training: AngularJS
Mini-Training: AngularJS
 
Angular JS tutorial
Angular JS tutorialAngular JS tutorial
Angular JS tutorial
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS Basics
 
SPA, Scalable Application & AngularJS
SPA, Scalable Application & AngularJSSPA, Scalable Application & AngularJS
SPA, Scalable Application & AngularJS
 

Viewers also liked

Social Website
Social WebsiteSocial Website
Social Website
Nishan Shah
 
Final ppt
Final pptFinal ppt
Final ppt
Hritesh Saha
 
Presentation
PresentationPresentation
Presentation
shekhaman
 
OMG, My Mom's on Facebook
OMG, My Mom's on FacebookOMG, My Mom's on Facebook
OMG, My Mom's on Facebook
Lana Carlene
 
Data flow diagram
Data flow diagramData flow diagram
Data flow diagram
Suman Kumar
 
FIT ENGINEERING COLLEGE
FIT ENGINEERING COLLEGEFIT ENGINEERING COLLEGE
FIT ENGINEERING COLLEGE
Roshni kumari
 
Dfd
DfdDfd
Online career building sites se report
Online career building sites se reportOnline career building sites se report
Online career building sites se report
Annie Thomas
 
Creating a Global E-Commerce Website With E-Business Suite and Fusion Middleware
Creating a Global E-Commerce Website With E-Business Suite and Fusion MiddlewareCreating a Global E-Commerce Website With E-Business Suite and Fusion Middleware
Creating a Global E-Commerce Website With E-Business Suite and Fusion Middleware
Brian Huff
 
Java Online Job Portal Presentation
Java Online Job Portal PresentationJava Online Job Portal Presentation
Java Online Job Portal Presentation
tanmanrai
 
E-work ppt
E-work pptE-work ppt
E-work ppt
Rajan Mishra
 
Course registration system
Course registration systemCourse registration system
Course registration system
Barani Tharan
 
Job portal
Job portalJob portal
Job portal
Amit Gandhi
 
Online Job Portal ppt presentation
Online Job Portal ppt presentationOnline Job Portal ppt presentation
Online Job Portal ppt presentation
Prateek Kulshrestha
 
Dfd and flowchart
Dfd and flowchartDfd and flowchart
Dfd and flowchart
Mir Majid
 
DFD for E-Commerce Website
DFD for E-Commerce WebsiteDFD for E-Commerce Website
DFD for E-Commerce Website
Rabart Kurrey
 
JOB PORTAL SYSTEM
JOB PORTAL SYSTEMJOB PORTAL SYSTEM
JOB PORTAL SYSTEM
PIYUSH Dubey
 
Online job portal
Online job portal Online job portal
Online job portal
Aj Maurya
 
Data Flow Diagram and Sequence Diagram
Data Flow Diagram and Sequence DiagramData Flow Diagram and Sequence Diagram
Data Flow Diagram and Sequence Diagram
Hamna Shahzad
 
LinkedIn's Latest Updates for Your Business
LinkedIn's Latest Updates for Your BusinessLinkedIn's Latest Updates for Your Business
LinkedIn's Latest Updates for Your Business
HubSpot
 

Viewers also liked (20)

Social Website
Social WebsiteSocial Website
Social Website
 
Final ppt
Final pptFinal ppt
Final ppt
 
Presentation
PresentationPresentation
Presentation
 
OMG, My Mom's on Facebook
OMG, My Mom's on FacebookOMG, My Mom's on Facebook
OMG, My Mom's on Facebook
 
Data flow diagram
Data flow diagramData flow diagram
Data flow diagram
 
FIT ENGINEERING COLLEGE
FIT ENGINEERING COLLEGEFIT ENGINEERING COLLEGE
FIT ENGINEERING COLLEGE
 
Dfd
DfdDfd
Dfd
 
Online career building sites se report
Online career building sites se reportOnline career building sites se report
Online career building sites se report
 
Creating a Global E-Commerce Website With E-Business Suite and Fusion Middleware
Creating a Global E-Commerce Website With E-Business Suite and Fusion MiddlewareCreating a Global E-Commerce Website With E-Business Suite and Fusion Middleware
Creating a Global E-Commerce Website With E-Business Suite and Fusion Middleware
 
Java Online Job Portal Presentation
Java Online Job Portal PresentationJava Online Job Portal Presentation
Java Online Job Portal Presentation
 
E-work ppt
E-work pptE-work ppt
E-work ppt
 
Course registration system
Course registration systemCourse registration system
Course registration system
 
Job portal
Job portalJob portal
Job portal
 
Online Job Portal ppt presentation
Online Job Portal ppt presentationOnline Job Portal ppt presentation
Online Job Portal ppt presentation
 
Dfd and flowchart
Dfd and flowchartDfd and flowchart
Dfd and flowchart
 
DFD for E-Commerce Website
DFD for E-Commerce WebsiteDFD for E-Commerce Website
DFD for E-Commerce Website
 
JOB PORTAL SYSTEM
JOB PORTAL SYSTEMJOB PORTAL SYSTEM
JOB PORTAL SYSTEM
 
Online job portal
Online job portal Online job portal
Online job portal
 
Data Flow Diagram and Sequence Diagram
Data Flow Diagram and Sequence DiagramData Flow Diagram and Sequence Diagram
Data Flow Diagram and Sequence Diagram
 
LinkedIn's Latest Updates for Your Business
LinkedIn's Latest Updates for Your BusinessLinkedIn's Latest Updates for Your Business
LinkedIn's Latest Updates for Your Business
 

Similar to Angular js

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
 
AngularJS
AngularJSAngularJS
AngularJS
Mahmoud Tolba
 
Angularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetupAngularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetup
Goutam Dey
 
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
Perfomatix Solutions
 
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
 
Angular
AngularAngular
AngularJS Introduction, how to run Angular
AngularJS Introduction, how to run AngularAngularJS Introduction, how to run Angular
AngularJS Introduction, how to run Angular
SamuelJohnpeter
 
AngularJS
AngularJSAngularJS
Overview of the AngularJS framework
Overview of the AngularJS framework Overview of the AngularJS framework
Overview of the AngularJS framework
Yakov Fain
 
Exploring AngularJS - Liju Pillai
Exploring AngularJS - Liju PillaiExploring AngularJS - Liju Pillai
Exploring AngularJS - Liju Pillai
Liju Pillai
 
Introduction to AngularJs
Introduction to AngularJsIntroduction to AngularJs
Introduction to AngularJs
murtazahaveliwala
 
Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to Angularjs
Gaurav Agrawal
 
AngularJs Basic Concept
AngularJs Basic ConceptAngularJs Basic Concept
AngularJs Basic Concept
Hari Haran
 
Angular js 1.0-fundamentals
Angular js 1.0-fundamentalsAngular js 1.0-fundamentals
Angular js 1.0-fundamentals
Venkatesh Narayanan
 
Asp.Net MVC 5 in Arabic
Asp.Net MVC 5 in ArabicAsp.Net MVC 5 in Arabic
Asp.Net MVC 5 in Arabic
Haitham Shaddad
 
Introduction to Angularjs
Introduction to AngularjsIntroduction to Angularjs
Introduction to Angularjs
Manish Shekhawat
 
Introduction to Angularjs : kishan kumar
Introduction to Angularjs : kishan kumarIntroduction to Angularjs : kishan kumar
Introduction to Angularjs : kishan kumar
Appfinz Technologies
 
AgularJS basics- angular directives and controllers
AgularJS basics- angular directives and controllersAgularJS basics- angular directives and controllers
AgularJS basics- angular directives and controllers
jobinThomas54
 
Angular JS, A dive to concepts
Angular JS, A dive to conceptsAngular JS, A dive to concepts
Angular JS, A dive to concepts
Abhishek Sur
 
Angular js 1.3 basic tutorial
Angular js 1.3 basic tutorialAngular js 1.3 basic tutorial
Angular js 1.3 basic tutorial
Al-Mutaz Bellah Salahat
 

Similar to Angular js (20)

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
 
AngularJS
AngularJSAngularJS
AngularJS
 
Angularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetupAngularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetup
 
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
 
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
 
Angular
AngularAngular
Angular
 
AngularJS Introduction, how to run Angular
AngularJS Introduction, how to run AngularAngularJS Introduction, how to run Angular
AngularJS Introduction, how to run Angular
 
AngularJS
AngularJSAngularJS
AngularJS
 
Overview of the AngularJS framework
Overview of the AngularJS framework Overview of the AngularJS framework
Overview of the AngularJS framework
 
Exploring AngularJS - Liju Pillai
Exploring AngularJS - Liju PillaiExploring AngularJS - Liju Pillai
Exploring AngularJS - Liju Pillai
 
Introduction to AngularJs
Introduction to AngularJsIntroduction to AngularJs
Introduction to AngularJs
 
Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to Angularjs
 
AngularJs Basic Concept
AngularJs Basic ConceptAngularJs Basic Concept
AngularJs Basic Concept
 
Angular js 1.0-fundamentals
Angular js 1.0-fundamentalsAngular js 1.0-fundamentals
Angular js 1.0-fundamentals
 
Asp.Net MVC 5 in Arabic
Asp.Net MVC 5 in ArabicAsp.Net MVC 5 in Arabic
Asp.Net MVC 5 in Arabic
 
Introduction to Angularjs
Introduction to AngularjsIntroduction to Angularjs
Introduction to Angularjs
 
Introduction to Angularjs : kishan kumar
Introduction to Angularjs : kishan kumarIntroduction to Angularjs : kishan kumar
Introduction to Angularjs : kishan kumar
 
AgularJS basics- angular directives and controllers
AgularJS basics- angular directives and controllersAgularJS basics- angular directives and controllers
AgularJS basics- angular directives and controllers
 
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 1.3 basic tutorial
Angular js 1.3 basic tutorialAngular js 1.3 basic tutorial
Angular js 1.3 basic tutorial
 

Recently uploaded

Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
Ivo Velitchkov
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
AstuteBusiness
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
Fwdays
 
Demystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through StorytellingDemystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through Storytelling
Enterprise Knowledge
 
From Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMsFrom Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMs
Sease
 
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
christinelarrosa
 
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
DanBrown980551
 
Must Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during MigrationMust Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during Migration
Mydbops
 
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance PanelsNorthern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
UiPathCommunity
 
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid ResearchHarnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
Neo4j
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
Safe Software
 
Christine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptxChristine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptx
christinelarrosa
 
A Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's ArchitectureA Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's Architecture
ScyllaDB
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Neo4j
 
"NATO Hackathon Winner: AI-Powered Drug Search", Taras Kloba
"NATO Hackathon Winner: AI-Powered Drug Search",  Taras Kloba"NATO Hackathon Winner: AI-Powered Drug Search",  Taras Kloba
"NATO Hackathon Winner: AI-Powered Drug Search", Taras Kloba
Fwdays
 
QA or the Highway - Component Testing: Bridging the gap between frontend appl...
QA or the Highway - Component Testing: Bridging the gap between frontend appl...QA or the Highway - Component Testing: Bridging the gap between frontend appl...
QA or the Highway - Component Testing: Bridging the gap between frontend appl...
zjhamm304
 

Recently uploaded (20)

Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
 
Demystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through StorytellingDemystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through Storytelling
 
From Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMsFrom Natural Language to Structured Solr Queries using LLMs
From Natural Language to Structured Solr Queries using LLMs
 
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
 
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
 
Must Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during MigrationMust Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during Migration
 
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance PanelsNorthern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
 
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid ResearchHarnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
 
Christine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptxChristine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptx
 
A Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's ArchitectureA Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's Architecture
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 
"NATO Hackathon Winner: AI-Powered Drug Search", Taras Kloba
"NATO Hackathon Winner: AI-Powered Drug Search",  Taras Kloba"NATO Hackathon Winner: AI-Powered Drug Search",  Taras Kloba
"NATO Hackathon Winner: AI-Powered Drug Search", Taras Kloba
 
QA or the Highway - Component Testing: Bridging the gap between frontend appl...
QA or the Highway - Component Testing: Bridging the gap between frontend appl...QA or the Highway - Component Testing: Bridging the gap between frontend appl...
QA or the Highway - Component Testing: Bridging the gap between frontend appl...
 

Angular js

  • 2. What is AngularJS?  A JavaScript framework for creating dynamic web applications  Open Source • GitHub: https://github.com/angular/angular.js • MIT License  Uses jQuery • jQuery 1.7.1 or above • jQLite
  • 3. MVC  Model • The data  Controller • The behavior • Modifying / updating the models  View • The interface • How the data is presented to the user JavaScript HTML
  • 4. Data Binding  Views are declarative • The structure of the interface  Controllers do not need to directly manipulate the view • Changes in the models / data are automatically reflected in the view • Updates are managed by the frameworks
  • 5. Sample Application  GitHub: • https://github.com/christophertfoo/AngularSample
  • 6. Views  Make use of special ng attributes (directives) on the HTML elements • ng-app • Determines which part of the page will use AngularJS • If given a value it will load that application module • ng-controller • Determines which Javascript Controller should be used for that part of the page • ng-model • Determines what model the value of an input field will be bound to • Used for two-way binding
  • 7. Views  More ng directives • ng-if=“<model expression>” • Inserts HTML element if expression is true • Does not insert element in the DOM if it is false • ng-repeat=“<variable> in <array>” • Repeats the HTML element for each value in the array • Also a key-value pair version for JSON objects • “(<key>, <value>) in <JSON>”
  • 8. Views  {{ }} • Angular expressions • Like JavaScript expressions except: • Evaluated in the current scope (see Controllers later on), not the global window • More forgiving to undefined and null errors • No control statements: conditionals, loops, or throw • Insert model values directly into the view
  • 9. Controller  Function that takes at least one parameter: $scope • Function is a constructor • Ex: • function MyCtrl($scope) { … } • We will see a different way of creating a controller constructor later  $scope • JavaScript object • Contains data (i.e. models) and methods (i.e. functions) • Can add own properties • $scope.<my new property> = <value>;
  • 10. Controller  Dependency Injection • Pass the modules and services that you need as parameters • In the previous case $scope is a service that will be injected • Can be passed as an array of strings to the controller function as well • Prevents errors when performing minification • Other useful services • $http • Used to handle Ajax calls • Wrappers around jQuery
  • 11. Controller  Typically also contains module loading  angular.module(<name>, [<dependencies>]); • Creates a module with the given name • This module can then be configured • Ex. • var myApp = angular.module(‘myApp’, []); myApp.controller(‘MyCtrl’, function($scope) { … }); myApp.controller(‘OtherCtrl’, [‘$scope’, ‘$http’, function($scope, $http) { … }]);
  • 12. Models  Properties on the Controller’s $scope object  Standard JavaScript values
  • 13. Modules  Can be used to separate the application into parts  Application module can include the other modules by listing them as dependencies
  • 14. Modules var myControllers = angular.module(‘myControllers’, []); // Add controllers to the module myControllers.controller(…); var myApp = angular.module(‘myApp’, [‘myControllers’]);
  • 15. More  You can do a lot more with AngularJS • Custom directives • http://docs.angularjs.org/guide/directive • Filters • http:// docs.angularjs.org/guide/dev_guide.templates.filters  To learn more: • Tutorial: http://docs.angularjs.org/tutorial • Documentation: http://docs.angularjs.org /guide/overview
  • 16. Thank you for listening!  Questions / Comments?
  • 17. Routing  Use different views for different URL fragments  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
  • 18. Routing  Enable by injecting the $routeProvider • myApp = angular.module(‘myApp’, [‘ngRoute’]); myApp.config([‘$routeProvider’, function($routeProvider) { … }]);  $routeProvider.when(<path>, {<route>}); • Defines a new route that uses the given path • The path may have parameters • Parameters start with a colon (‘:’) • Ex • ‘/user/:userId’ • Typical route fields: • controller = The name of the controller that should be used • templateUrl = A path to the template partial that should be used  $routeProvider.otherwise({<route>}); • Typical route fields: • redirectTo: ‘<path>’  API: http://docs.angularjs.org/api/ngRoute.$routeProvider
  • 19. Routing  URL parameters • To access the parameters in the URL, use the $routeParams service • The $routeParams object will have a field with the same name as the parameter • Ex. • $routeParams.userId
  • 20. Routing  Paths default to Hashbang mode • Example URL. • http://www.mysite.com/#/users  Can use HTML 5 mode by configuring the $locationProvider • Ex. • // Inject $locationProvider into the module using config $locationProvider.html5Mode(true); • Example URL: • http://www.mysite.com/users