SlideShare uma empresa Scribd logo
1 de 35
Javascript for Designers

Twitter @dgoutam
History
• Origins within Google, invented by Misko
Hevery
• Open-sourced 2009
• 17,000 lines in 6 months => 1,500 in 3 weeks
Killer Features
•
•
•
•

Two-way binding
Declarative coding for UI
Teaching HTML new tricks
Separation of model & view, No DOM/View
manipulation, less code
• Great for CRUD based single page apps
• Awesome adoption and great community
• Unit testable, E2E testable
http://angularjs.org
ng-app, expression binding
ng-app, expression binding
• Include angular.js or angular.min.js
• Add ng-app declarative where you want
Angular to manage app (typically <html> or
<body>)
• Expression binding with {{ }}
• ng-app can also be written as ngApp
• Use camel case in JavaScript code (ngApp) and
use snake case in html (ng-app)
How does it work
• 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.
ngModel, binding variables
• 02-ngModel
• ng-model binds variable data. It can be
declared on input, select, textarea, etc.
Two-way data binding
Jquery vs Angular
Differences from jQuery
• Declarative code, not imperative (explicitly
stating, say with functions, what action needs
to be performed)
• Automatic data binding
• No direct DOM manipulation
More expressions
Expressions
• Expressions can be embedded anywhere
• … even for class values
• There are special filters that you can use
(currency)
• Values are automatically bound
MVC
Scope and Controller
Learnings
• Controller objects can separate data and
functionality
– There can be many controllers

• ‘$scope’ is injected by AngularJS
• $scope.data in the controller is referred to as
simply data in html
• Dot notation for object members works
(person.age)
– In fact, this is suggested practice
Scope, Controller, View
How AngularJS does MVC
Dependency Injection
Method on Scope
ngClick
ngRepeat
ngRepeat
Filters
Other inbuilt filters
Modules in AngularJS
• Third party code can be packaged as reusable
modules.
• The modules can be loaded in any/parallel
order (due to delayed nature of module
execution).
• Some Angular modules are in separate files:
Eg. ngRoute is in angularjs-route.min.js
ngView and Routing
$http
$http
• Make AJAX calls with $http
• It returns deferred promises
– More in later workshops

• You can handle ‘success’ and ‘error’
Working with angular-seed
• https://github.com/angular/angular-seed
• You need to have node.js installed to test
Custom Filter
Custom Directive
What we didn’t cover
•
•
•
•
•

Unit testing, E2E testing
Custom directives beyond basics
$apply and digest cycles
$q and promises
Service, Factory, Provider
Resources
•
•
•
•
•
•
•

angularjs.org
Google Groups: AngularJS
Google+: AngularJS
ngmodules.org
Github: angular-ui.github.io
Google+: AngularJS India
https://www.facebook.com/groups/25576918
4523171/
Angularjs for kolkata drupal meetup

Mais conteúdo relacionado

Mais procurados

Angularjs beginners-workshop1
Angularjs beginners-workshop1Angularjs beginners-workshop1
Angularjs beginners-workshop1
Jugnu Sharma
 

Mais procurados (20)

Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
 
Step by Step - AngularJS
Step by Step - AngularJSStep by Step - AngularJS
Step by Step - AngularJS
 
PPT on Angular 2 Development Tutorial
PPT on Angular 2 Development TutorialPPT on Angular 2 Development Tutorial
PPT on Angular 2 Development Tutorial
 
Angular js
Angular jsAngular js
Angular js
 
AngularJS 2.0: A natural evolvement or a new beginning - Boyan Mihaylov - Cod...
AngularJS 2.0: A natural evolvement or a new beginning - Boyan Mihaylov - Cod...AngularJS 2.0: A natural evolvement or a new beginning - Boyan Mihaylov - Cod...
AngularJS 2.0: A natural evolvement or a new beginning - Boyan Mihaylov - Cod...
 
AngularJS One Day Workshop
AngularJS One Day WorkshopAngularJS One Day Workshop
AngularJS One Day Workshop
 
Introduction to Angular JS
Introduction to Angular JSIntroduction to Angular JS
Introduction to Angular JS
 
Introduction To JavaScript Ajax
Introduction To JavaScript AjaxIntroduction To JavaScript Ajax
Introduction To JavaScript Ajax
 
Javascript 01 (js)
Javascript 01 (js)Javascript 01 (js)
Javascript 01 (js)
 
AngularJS intro
AngularJS introAngularJS intro
AngularJS intro
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
AngularJS Introduction
AngularJS IntroductionAngularJS Introduction
AngularJS Introduction
 
Angular js for Beginnners
Angular js for BeginnnersAngular js for Beginnners
Angular js for Beginnners
 
Angularjs beginners-workshop1
Angularjs beginners-workshop1Angularjs beginners-workshop1
Angularjs beginners-workshop1
 
Web Components
Web ComponentsWeb Components
Web Components
 
Moving From AngularJS to Angular 2
Moving From AngularJS to  Angular 2 Moving From AngularJS to  Angular 2
Moving From AngularJS to Angular 2
 
Next generation testing
Next generation testingNext generation testing
Next generation testing
 
Angular js
Angular jsAngular js
Angular js
 
AngularJS 2.0
AngularJS 2.0AngularJS 2.0
AngularJS 2.0
 

Semelhante a Angularjs for kolkata drupal meetup

Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5
Ganesh Kondal
 

Semelhante a Angularjs for kolkata drupal meetup (20)

Angularjs
AngularjsAngularjs
Angularjs
 
AngularJS
AngularJSAngularJS
AngularJS
 
Integrating AngularJS into the Campus CMS
Integrating AngularJS into the Campus CMSIntegrating AngularJS into the Campus CMS
Integrating AngularJS into the Campus CMS
 
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
Introduction to AngularJsIntroduction to AngularJs
Introduction to AngularJs
 
Angular JS, A dive to concepts
Angular JS, A dive to conceptsAngular JS, A dive to concepts
Angular JS, A dive to concepts
 
Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5
 
CraftCamp for Students - Introduction to AngularJS
CraftCamp for Students - Introduction to AngularJSCraftCamp for Students - Introduction to AngularJS
CraftCamp for Students - Introduction to AngularJS
 
Angular patterns
Angular patternsAngular patterns
Angular patterns
 
Angular js
Angular jsAngular js
Angular js
 
AngularJS
AngularJSAngularJS
AngularJS
 
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
 
Valentine with Angular js - Introduction
Valentine with Angular js - IntroductionValentine with Angular js - Introduction
Valentine with Angular js - Introduction
 
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
 
Exploring AngularJS - Liju Pillai
Exploring AngularJS - Liju PillaiExploring AngularJS - Liju Pillai
Exploring AngularJS - Liju Pillai
 
Angular js
Angular jsAngular js
Angular js
 
Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - Introduction
 
AngularJs presentation
AngularJs presentation AngularJs presentation
AngularJs presentation
 
ME vs WEB - AngularJS Fundamentals
ME vs WEB - AngularJS FundamentalsME vs WEB - AngularJS Fundamentals
ME vs WEB - AngularJS Fundamentals
 
Angular js 1.3 presentation for fed nov 2014
Angular js 1.3 presentation for fed   nov 2014Angular js 1.3 presentation for fed   nov 2014
Angular js 1.3 presentation for fed nov 2014
 

Último

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

Angularjs for kolkata drupal meetup

Notas do Editor

  1. they start with an anecdote, discussing how they were working on a web application at Google. They have already written 17000 lines of code in about 6 months and it was almost finished, albeit with great frustration related to development speed and testability. This guy, Miško Hevery, tells everyone that by using a framework that he wrote in his spare time (you gotta love devs!) they could rewrite the whole application in two weeks. He was wrong, they did it in three weeks and at the end the whole thing has only 1500 lines of code and was fully testable. 90% less code, in 90% less time. And it was very testable.
  2. Compiler Compiler is an angular service which traverses the DOM looking for attributes. The compilation process happens into 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. Making the scope model a single source of truth. Some directives such ng-repeat clone DOM elements once for each item in collection. Having a compile and link phase improves performance since the cloned template only needs to be compiled once, and then linked once for each clone instance.
  3. http://slid.es/neenhouse/dependency-injection-in-angularjs