SlideShare uma empresa Scribd logo
1 de 28
HTML enhanced for web apps!
Agenda 
 AngularJS: Introduction 
 Introduction to Single-Page-Apps 
 Understand what AngularJS is and why it's important 
 Installing AngularJS 
 Write your first AngularJS application 
 Understand Data-binding, Directives, Filters, Controller 
& View 
 Run AngularJS application using HTTP server
Introduction 
 A 100% client-side and 100% JavaScript Framework 
 Free and open source (MIT License) 
 Built with modern development principles in mind 
 Flexible 
 Modularity 
 Versatility 
 Testability 
 Re-use, Less Code 
 SPA 
 Quick prototyping 
 Extensible
Introduction 
 Current Version - 1.2.27 
 Work in progress - 2.0 (to be mobile-first) 
 Has a port available in Dart (AngularDart) 
 Vibrant and growing community 
 Project homepage – angularjs.org 
 Guide – docs.angularjs.org/guide 
 API reference - docs.angularjs.org/api 
 Browser support – Firefox, Chrome, Safar, IE8+*
What is AngularJS?
AngularJS - MVWhatever Design 
Model View Controller 
*Image courtesy: https://github.com/shamsher31/yii-training-day-1/blob/master/img/mvc.jpg
AngularJS - MVWhatever Design 
 Supports MVC, MVP, MVVM patterns 
*Image courtesy: http://www.ace-dnn.com/knowledge-base/implementation-of-mvvm-design-pattern-in-dnn.aspx
Traditional Apps – Multi-Page Apps 
 Full page reloaded on hopping 
between pages 
 Server communication includes 
all resources in a page 
 URLs look like – 
 domain.com/login.html, 
 domain.com/welcome.html 
 domain.com/search 
 Examples – Linkedin, NYTimes, 
hrms 
*Image courtesy: http://weblogs.asp.net/dwahlin/video-tutorial-angularjs-fundamentals-in-60-ish-minutes
Modern Apps – Single Page Apps 
 Optimized - pages do NOT reload 
completely 
 Server communication reduces to 
just data jsons or partial markups 
 URLs look like – 
 domain.com/app.html#login, 
 domain.com/app.html#welcome 
 domain.com/app#!search 
 Examples – Gmail, Twitter, 
Facebook etc. 
*Image courtesy: http://angularjs-demo-app.herokuapp.com/
AngularJS 
 Full-featured SPA framework 
 Templating 
 Routing 
 Deep Linking 
 History
AngularJS Features 
 Data-binding 
 Directives 
 Dependency Injection 
 Form Validation 
 Server Communication 
 Localization 
 Embeddable 
 Plain JavaScript 
 etc.
Working with AngularJS
Getting Started 
 Getting Scripts - 
 Download directly via angularjs.org 
 CDN 
 Tools – 
 Bower 
 Yeoman 
<!DOCTYPE html> 
<html> 
<head> 
<title>My App</title> 
<script src="js/libs/angular.js"></script> 
</head> 
<body ng-app> 
<div> 
<input type="text" ng-model="myString" /> 
{{ myString }} 
</div> 
</body> 
</html>
Application Layout
Data-Binding 
 Automatic & Two-way: View to Model & Model to View 
 Eliminates need of event binding and handling 
 Achieved through 
 ng-model directive <input type=“text” ng-model=“foo” /> 
 {{ }} bindings, {{ foo }} 
 $scope object $scope.foo = ‘hello!’; 
 $watch method $scope.$watch(‘foo’, function(newVal, oldVal){ 
// do something here }); 
 Pass between controllers, directives 
 etc..
Directives 
 Lets you *invent* new HTML syntax 
 Create new tags, attributes, as a css class 
 Change existing tags, attributes with new meanings 
 Lets you abstract markup in a template 
 Examples – 
 ng-app <body ng-app> 
 ng-init <div ng-init=“foo = 1000”> 
 ng-model <input type=“text” ng-model=“foo” /> 
 ng-controller <div ng-controller=“MyController”> 
 ng-view (for routing) <ng-view /> 
 ng-class, ng-show, ng-hide <div ng-show=“isValid”> 
 ng-repeat <li ng-repeat=“item in myList”> {{item.name}} </li> 
 ng-click, ng-dblclick, ng-submit <button ng-click=“doSomething()”>Click Me</button> 
 Many many more - here
Bindings, Expressions, Filters 
 Binding – {{ <expression> | filter | orderBy }} 
 To be used in Views/HTML. 
 Expressions – 
 JavaScript *like* code-snippets – {{ 1 + 2 }}, {{ ‘hello World!’ }} 
 Evaluated against a ‘$scope’ object – {{ a + b }}, {{ user.name 
}}, {{ items[index] }}, {{ doSomething() }} 
 *Cannot* use conditionals, loops & exceptions 
 Filters – Data formatters 
 lowercase, currency, date & any custom-filters 
 orderBy – Sorts filtered result-set
Demo 1 
Data binding, built-in directives
Anatomy of an Angular App 
Basic 
<!DOCTYPE html> 
<html> 
<head> 
<title>My App</title> 
<script src="js/libs/angular.js"></script> 
</head> 
<body ng-app> 
<div> 
<input type="text" ng-model="myString" /> 
{{ myString }} 
</div> 
</body> 
</html>
Anatomy of an Angular App 
Better 
<!DOCTYPE html> 
<html> 
<head> 
<title>My App</title> 
<script src="js/libs/angular.js"></script> 
<script src="js/app.js"></script> 
</head> 
<body ng-app> 
<div ng-controller=“MyController”> 
<input type="text" ng-model="myString" /> 
{{ myString }} 
</div> 
</body> 
</html> 
// app.js 
function MyController($scope) { 
$scope.myString = ‘hello world!’; 
}
Anatomy of an Angular App 
Even better – using Modules 
<!DOCTYPE html> 
<html> 
<head> 
<title>My App</title> 
<script src="js/libs/angular.js"></script> 
<script src="js/app.js"></script> 
</head> 
<body ng-app=“myApp”> 
<div ng-controller=“MyController”> 
<input type="text" ng-model="myString" /> 
{{ myString }} 
</div> 
</body> 
</html> 
// app.js 
var myApp = angular.module('myApp', []); 
myApp.controller(‘MyController’, [‘$scope’, function($scope) { 
$scope.myString = ‘hello world!’; 
}]);
Controllers 
 Used to provide business logic, methods for the view 
 Makes use of “Services” 
 Provided with “scope” object 
 Dependencies are “injected”
Views 
 Used for interaction by user 
 Simple HTML, CSS files 
 Can work on models directly 
 Recommendation 
 Use controllers for any manipulations 
 Use directive for explicit HTML manipulations 
 Useful Directives – ng-controller, ng-include, ng-view
Demo 2 
Anatomy – 
• Basic 
• Better 
• Best
Running using HTTPServers 
 Any web server which can serve static HTML pages 
 Options: NodeJS or Python 
 NodeJS: 
 Install NodeJS – instructions here 
 Install Express - $ my_app> npm install express 
 Create a script (server.js) – 
var express = require('express'); 
var app = express(); 
app.use(express.static(__dirname + '/static')); 
app.listen(3000, function(err) { 
if (err) { 
console.log('Server couldn't be started!', err); 
} else { 
console.log('Server started.'); 
} 
}); 
 $ my_app > node server.js
Questions.. ?
References 
 Articles 
 AngularJS official guide 
 Use AngularJS to power your application 
 Why does AngularJS rock? 
 Rapid prototyping with AngularJs 
 AngularJs Form Validation 
 Videos 
 Official YouTube channel 
 AngularJs Fundamentals in 60-ish minutes 
 Writing Directives 
 Introduction to AngularJs Unit Testing 
 End to End testing of AngularJs apps with Protractor
Thank you! 
End of Day 1.

Mais conteúdo relacionado

Mais procurados

Advanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JSAdvanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JSSimon Guest
 
Controller in AngularJS
Controller in AngularJSController in AngularJS
Controller in AngularJSBrajesh Yadav
 
AngularJS Introduction
AngularJS IntroductionAngularJS Introduction
AngularJS IntroductionBrajesh Yadav
 
Shaping up with angular JS
Shaping up with angular JSShaping up with angular JS
Shaping up with angular JSBrajesh Yadav
 
AngularJS One Day Workshop
AngularJS One Day WorkshopAngularJS One Day Workshop
AngularJS One Day WorkshopShyam Seshadri
 
Understanding angular js
Understanding angular jsUnderstanding angular js
Understanding angular jsAayush Shrestha
 
Getting Started with Angular JS
Getting Started with Angular JSGetting Started with Angular JS
Getting Started with Angular JSAkshay Mathur
 
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
 
Gettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJSGettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJSArmin Vieweg
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJSDavid Parsons
 
Understanding angular js $rootscope and $scope
Understanding angular js $rootscope and $scopeUnderstanding angular js $rootscope and $scope
Understanding angular js $rootscope and $scopeBrajesh Yadav
 
Why angular js Framework
Why angular js Framework Why angular js Framework
Why angular js Framework Sakthi Bro
 

Mais procurados (20)

AngularJS Best Practices
AngularJS Best PracticesAngularJS Best Practices
AngularJS Best Practices
 
AngularJS Best Practices
AngularJS Best PracticesAngularJS Best Practices
AngularJS Best Practices
 
Advanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JSAdvanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JS
 
Directives
DirectivesDirectives
Directives
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Controller in AngularJS
Controller in AngularJSController in AngularJS
Controller in AngularJS
 
AngularJS
AngularJSAngularJS
AngularJS
 
AngularJS Introduction
AngularJS IntroductionAngularJS Introduction
AngularJS Introduction
 
Shaping up with angular JS
Shaping up with angular JSShaping up with angular JS
Shaping up with angular JS
 
AngularJS One Day Workshop
AngularJS One Day WorkshopAngularJS One Day Workshop
AngularJS One Day Workshop
 
Understanding angular js
Understanding angular jsUnderstanding angular js
Understanding angular js
 
Getting Started with Angular JS
Getting Started with Angular JSGetting Started with Angular JS
Getting Started with Angular JS
 
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 to Angular JS
Introduction to Angular JSIntroduction to Angular JS
Introduction to Angular JS
 
Gettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJSGettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJS
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Built in filters
Built in filtersBuilt in filters
Built in filters
 
Understanding angular js $rootscope and $scope
Understanding angular js $rootscope and $scopeUnderstanding angular js $rootscope and $scope
Understanding angular js $rootscope and $scope
 
Why angular js Framework
Why angular js Framework Why angular js Framework
Why angular js Framework
 
Introduction to Angularjs
Introduction to AngularjsIntroduction to Angularjs
Introduction to Angularjs
 

Destaque

01 startoff angularjs
01 startoff angularjs01 startoff angularjs
01 startoff angularjsErhwen Kuo
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJSAldo Pizzagalli
 
AngularJS performance & production tips
AngularJS performance & production tipsAngularJS performance & production tips
AngularJS performance & production tipsNir Kaufman
 
AngularJS application architecture
AngularJS application architectureAngularJS application architecture
AngularJS application architectureGabriele Falace
 
Single Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJSSingle Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJSM R Rony
 
Advanced AngularJS Concepts
Advanced AngularJS ConceptsAdvanced AngularJS Concepts
Advanced AngularJS ConceptsKyle Hodgson
 

Destaque (8)

Training On Angular Js
Training On Angular JsTraining On Angular Js
Training On Angular Js
 
Angular js 1.0-fundamentals
Angular js 1.0-fundamentalsAngular js 1.0-fundamentals
Angular js 1.0-fundamentals
 
01 startoff angularjs
01 startoff angularjs01 startoff angularjs
01 startoff angularjs
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
AngularJS performance & production tips
AngularJS performance & production tipsAngularJS performance & production tips
AngularJS performance & production tips
 
AngularJS application architecture
AngularJS application architectureAngularJS application architecture
AngularJS application architecture
 
Single Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJSSingle Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJS
 
Advanced AngularJS Concepts
Advanced AngularJS ConceptsAdvanced AngularJS Concepts
Advanced AngularJS Concepts
 

Semelhante a AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS

Angular Js Get Started - Complete Course
Angular Js Get Started - Complete CourseAngular Js Get Started - Complete Course
Angular Js Get Started - Complete CourseEPAM Systems
 
AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014Ran Wahle
 
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
 
AngularJS Mobile Warsaw 20-10-2014
AngularJS Mobile Warsaw 20-10-2014AngularJS Mobile Warsaw 20-10-2014
AngularJS Mobile Warsaw 20-10-2014Dariusz Kalbarczyk
 
angularJs Workshop
angularJs WorkshopangularJs Workshop
angularJs WorkshopRan Wahle
 
Angular JS deep dive
Angular JS deep diveAngular JS deep dive
Angular JS deep diveAxilis
 
Workshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte IWorkshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte IVisual Engineering
 
The Basics Angular JS
The Basics Angular JS The Basics Angular JS
The Basics Angular JS OrisysIndia
 
Angular1x and Angular 2 for Beginners
Angular1x and Angular 2 for BeginnersAngular1x and Angular 2 for Beginners
Angular1x and Angular 2 for BeginnersOswald Campesato
 
gDayX 2013 - Advanced AngularJS - Nicolas Embleton
gDayX 2013 - Advanced AngularJS - Nicolas EmbletongDayX 2013 - Advanced AngularJS - Nicolas Embleton
gDayX 2013 - Advanced AngularJS - Nicolas EmbletonGeorge Nguyen
 

Semelhante a AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS (20)

Angular Js Get Started - Complete Course
Angular Js Get Started - Complete CourseAngular Js Get Started - Complete Course
Angular Js Get Started - Complete Course
 
AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014
 
AngularJS
AngularJSAngularJS
AngularJS
 
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
 
Angular Js Basics
Angular Js BasicsAngular Js Basics
Angular Js Basics
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
AngularJS Mobile Warsaw 20-10-2014
AngularJS Mobile Warsaw 20-10-2014AngularJS Mobile Warsaw 20-10-2014
AngularJS Mobile Warsaw 20-10-2014
 
angularJs Workshop
angularJs WorkshopangularJs Workshop
angularJs Workshop
 
Angular JS deep dive
Angular JS deep diveAngular JS deep dive
Angular JS deep dive
 
Introduction to Angular Js
Introduction to Angular JsIntroduction to Angular Js
Introduction to Angular Js
 
Workshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte IWorkshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte I
 
Introduction to AngularJs
Introduction to AngularJsIntroduction to AngularJs
Introduction to AngularJs
 
Custom directive and scopes
Custom directive and scopesCustom directive and scopes
Custom directive and scopes
 
AngularJS 1.x training
AngularJS 1.x trainingAngularJS 1.x training
AngularJS 1.x training
 
The Basics Angular JS
The Basics Angular JS The Basics Angular JS
The Basics Angular JS
 
Valentine with AngularJS
Valentine with AngularJSValentine with AngularJS
Valentine with AngularJS
 
Angular1x and Angular 2 for Beginners
Angular1x and Angular 2 for BeginnersAngular1x and Angular 2 for Beginners
Angular1x and Angular 2 for Beginners
 
Angular js workshop
Angular js workshopAngular js workshop
Angular js workshop
 
gDayX 2013 - Advanced AngularJS - Nicolas Embleton
gDayX 2013 - Advanced AngularJS - Nicolas EmbletongDayX 2013 - Advanced AngularJS - Nicolas Embleton
gDayX 2013 - Advanced AngularJS - Nicolas Embleton
 
Basics of AngularJS
Basics of AngularJSBasics of AngularJS
Basics of AngularJS
 

Último

Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 

Último (20)

Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 

AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS

  • 1. HTML enhanced for web apps!
  • 2. Agenda  AngularJS: Introduction  Introduction to Single-Page-Apps  Understand what AngularJS is and why it's important  Installing AngularJS  Write your first AngularJS application  Understand Data-binding, Directives, Filters, Controller & View  Run AngularJS application using HTTP server
  • 3. Introduction  A 100% client-side and 100% JavaScript Framework  Free and open source (MIT License)  Built with modern development principles in mind  Flexible  Modularity  Versatility  Testability  Re-use, Less Code  SPA  Quick prototyping  Extensible
  • 4. Introduction  Current Version - 1.2.27  Work in progress - 2.0 (to be mobile-first)  Has a port available in Dart (AngularDart)  Vibrant and growing community  Project homepage – angularjs.org  Guide – docs.angularjs.org/guide  API reference - docs.angularjs.org/api  Browser support – Firefox, Chrome, Safar, IE8+*
  • 6. AngularJS - MVWhatever Design Model View Controller *Image courtesy: https://github.com/shamsher31/yii-training-day-1/blob/master/img/mvc.jpg
  • 7. AngularJS - MVWhatever Design  Supports MVC, MVP, MVVM patterns *Image courtesy: http://www.ace-dnn.com/knowledge-base/implementation-of-mvvm-design-pattern-in-dnn.aspx
  • 8. Traditional Apps – Multi-Page Apps  Full page reloaded on hopping between pages  Server communication includes all resources in a page  URLs look like –  domain.com/login.html,  domain.com/welcome.html  domain.com/search  Examples – Linkedin, NYTimes, hrms *Image courtesy: http://weblogs.asp.net/dwahlin/video-tutorial-angularjs-fundamentals-in-60-ish-minutes
  • 9. Modern Apps – Single Page Apps  Optimized - pages do NOT reload completely  Server communication reduces to just data jsons or partial markups  URLs look like –  domain.com/app.html#login,  domain.com/app.html#welcome  domain.com/app#!search  Examples – Gmail, Twitter, Facebook etc. *Image courtesy: http://angularjs-demo-app.herokuapp.com/
  • 10. AngularJS  Full-featured SPA framework  Templating  Routing  Deep Linking  History
  • 11. AngularJS Features  Data-binding  Directives  Dependency Injection  Form Validation  Server Communication  Localization  Embeddable  Plain JavaScript  etc.
  • 13. Getting Started  Getting Scripts -  Download directly via angularjs.org  CDN  Tools –  Bower  Yeoman <!DOCTYPE html> <html> <head> <title>My App</title> <script src="js/libs/angular.js"></script> </head> <body ng-app> <div> <input type="text" ng-model="myString" /> {{ myString }} </div> </body> </html>
  • 15. Data-Binding  Automatic & Two-way: View to Model & Model to View  Eliminates need of event binding and handling  Achieved through  ng-model directive <input type=“text” ng-model=“foo” />  {{ }} bindings, {{ foo }}  $scope object $scope.foo = ‘hello!’;  $watch method $scope.$watch(‘foo’, function(newVal, oldVal){ // do something here });  Pass between controllers, directives  etc..
  • 16. Directives  Lets you *invent* new HTML syntax  Create new tags, attributes, as a css class  Change existing tags, attributes with new meanings  Lets you abstract markup in a template  Examples –  ng-app <body ng-app>  ng-init <div ng-init=“foo = 1000”>  ng-model <input type=“text” ng-model=“foo” />  ng-controller <div ng-controller=“MyController”>  ng-view (for routing) <ng-view />  ng-class, ng-show, ng-hide <div ng-show=“isValid”>  ng-repeat <li ng-repeat=“item in myList”> {{item.name}} </li>  ng-click, ng-dblclick, ng-submit <button ng-click=“doSomething()”>Click Me</button>  Many many more - here
  • 17. Bindings, Expressions, Filters  Binding – {{ <expression> | filter | orderBy }}  To be used in Views/HTML.  Expressions –  JavaScript *like* code-snippets – {{ 1 + 2 }}, {{ ‘hello World!’ }}  Evaluated against a ‘$scope’ object – {{ a + b }}, {{ user.name }}, {{ items[index] }}, {{ doSomething() }}  *Cannot* use conditionals, loops & exceptions  Filters – Data formatters  lowercase, currency, date & any custom-filters  orderBy – Sorts filtered result-set
  • 18. Demo 1 Data binding, built-in directives
  • 19. Anatomy of an Angular App Basic <!DOCTYPE html> <html> <head> <title>My App</title> <script src="js/libs/angular.js"></script> </head> <body ng-app> <div> <input type="text" ng-model="myString" /> {{ myString }} </div> </body> </html>
  • 20. Anatomy of an Angular App Better <!DOCTYPE html> <html> <head> <title>My App</title> <script src="js/libs/angular.js"></script> <script src="js/app.js"></script> </head> <body ng-app> <div ng-controller=“MyController”> <input type="text" ng-model="myString" /> {{ myString }} </div> </body> </html> // app.js function MyController($scope) { $scope.myString = ‘hello world!’; }
  • 21. Anatomy of an Angular App Even better – using Modules <!DOCTYPE html> <html> <head> <title>My App</title> <script src="js/libs/angular.js"></script> <script src="js/app.js"></script> </head> <body ng-app=“myApp”> <div ng-controller=“MyController”> <input type="text" ng-model="myString" /> {{ myString }} </div> </body> </html> // app.js var myApp = angular.module('myApp', []); myApp.controller(‘MyController’, [‘$scope’, function($scope) { $scope.myString = ‘hello world!’; }]);
  • 22. Controllers  Used to provide business logic, methods for the view  Makes use of “Services”  Provided with “scope” object  Dependencies are “injected”
  • 23. Views  Used for interaction by user  Simple HTML, CSS files  Can work on models directly  Recommendation  Use controllers for any manipulations  Use directive for explicit HTML manipulations  Useful Directives – ng-controller, ng-include, ng-view
  • 24. Demo 2 Anatomy – • Basic • Better • Best
  • 25. Running using HTTPServers  Any web server which can serve static HTML pages  Options: NodeJS or Python  NodeJS:  Install NodeJS – instructions here  Install Express - $ my_app> npm install express  Create a script (server.js) – var express = require('express'); var app = express(); app.use(express.static(__dirname + '/static')); app.listen(3000, function(err) { if (err) { console.log('Server couldn't be started!', err); } else { console.log('Server started.'); } });  $ my_app > node server.js
  • 27. References  Articles  AngularJS official guide  Use AngularJS to power your application  Why does AngularJS rock?  Rapid prototyping with AngularJs  AngularJs Form Validation  Videos  Official YouTube channel  AngularJs Fundamentals in 60-ish minutes  Writing Directives  Introduction to AngularJs Unit Testing  End to End testing of AngularJs apps with Protractor
  • 28. Thank you! End of Day 1.