SlideShare a Scribd company logo
Drupal & AngularJS
DrupalCamp Spain 2014
Juampy Novillo Requena
Mateu Aguilo Bosh
About us (@e0ipso & @juampy72)
Drupal enthusiasts Developers at Lullabot
Glossary (1)
Front end developer / Themer
Someone who works in the presentational aspects of a
website.
Back end developer / Programmer
Someone who works in the architecture of a website.
Glossary (2)
Decouple
tr. separate, disengage, or dissociate (something) from
something else.
For Drupal: move areas of business logic from Drupal to the
client using JavaScript.
<html>
…
<div id=”the-js-page”></div>
…
</html>
title: “Ooops”,
link: “/search”,
image: “img.jpg”
Raw data sent to
the client.
Ooops
/search
Backend: Drupal Client: Browser
¿Why decoupling?
1. Theming in Drupal is tedious and tricky.
2. As an alternative to ESI in pages delivered
by reverse proxies.
3. Easier core upgrades.
1. Theming in Drupal is tedious and tricky
Hi themer! Here are hundred of thousands of
divs; and the CSS is scattered among these
files. Remember that if you touch core I will rip
your head off.
Good luck! :-D
http://a1.s6img.com/cdn/box_004/post_14/539443_1823194_lz.jpg
Against ...
Hi themer, make a
request to the
service $http('/mydata.json')
in JavaScript in order
to obtain the data.
You can write your own
CSS and HTML from
scratch.
http://www.vote29.com/newmyblog/wp-content/uploads/2012/09/moka-happy-dog3.jpg
2. As an alternative to ESI in pages
delivered by reverse proxies
Given a page, allow that certain areas are
dynamic but keep the rest been delivered by a
reverse proxy like Varnish.
AngularJS fetches the data
and renders the header.
Drupal + Varnish
take care of the rest
of the page.
Same header
embedded in a
different site
Assync calls to
different servers:
- Data server
- Server with the
AngularJS app
3. Easier core upgrades
@daniel_jacobson, ex CTO at National Public
Radio (www.npr.org).
Built a backend system which offered an API to
several client applications.
This backend system has been on for 12 years.
http://blog.programmableweb.com/2009/10/13/cope-create-once-publish-everywhere
As long as we
respect the structure
of the APIs
being consumed by
client apps, the
backend can evolve.
AngularJS is an MVC
JavaScript framework
which elegantly
separates controller,
business and model
logic in your
application.
AngularJS basics: directive
A Directive is a marker on a DOM element that tell AngularJS's
HTML compiler to attach a specified behavior to that DOM
element.
http://jsfiddle.net/e0ipso/9eXD9/
LIVE DEMO
AngularJS basics (2): controller
A Controller is a JavaScript constructor function that is
used to augment the Angular Scope.
LIVE DEMO
http://jsfiddle.net/e0ipso/t2N8b/2/
2-way data binding
The view can update the model and the model
can update the view. Out of the box.
LIVE DEMO
http://jsfiddle.net/e0ipso/PF3cP/1/
¿What about JQuery & Backbone?
There is no MVC separation as in AngularJS in
JQuery and Backbone.
They both lack 2-way data binding.
Example in AngularJS / jQuery / Backbone.
Full example: contact form
Source article
Hugs. Questions?
http://about.me/juampy
@juampy72
http://humanbits.es
@e0ipso

More Related Content

What's hot (20)

Nuxt Talk
Nuxt TalkNuxt Talk
Nuxt Talk
Sébastien Chopin
 
Adobe AEM for Business Heads
Adobe AEM for Business HeadsAdobe AEM for Business Heads
Adobe AEM for Business Heads
Yash Mody
 
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
Sencha
 
Bundle your modules with Webpack
Bundle your modules with WebpackBundle your modules with Webpack
Bundle your modules with Webpack
Jake Peyser
 
[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS
[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS
[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS
Srijan Technologies
 
Intro to Sails.js
Intro to Sails.jsIntro to Sails.js
Intro to Sails.js
DevOpsDays Austin 2014
 
ASP .NET MVC - best practices
ASP .NET MVC - best practicesASP .NET MVC - best practices
ASP .NET MVC - best practices
Bohdan Pashkovskyi
 
Nuxt.JS Introdruction
Nuxt.JS IntrodructionNuxt.JS Introdruction
Nuxt.JS Introdruction
David Ličen
 
Angular js
Angular jsAngular js
Angular js
yogi_solanki
 
Angular js
Angular jsAngular js
Angular js
Larry Ball
 
Backbonejs
BackbonejsBackbonejs
Backbonejs
SHASHI KUMAR
 
Angularjs Basics
Angularjs BasicsAngularjs Basics
Angularjs Basics
Jayantha Sirisena
 
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and ToolingSencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha
 
Packing for the Web with Webpack
Packing for the Web with WebpackPacking for the Web with Webpack
Packing for the Web with Webpack
Thiago Temple
 
AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS Basics
Nikita Shounewich
 
React basic by Yoav Amit, Wix
React basic by Yoav Amit, Wix React basic by Yoav Amit, Wix
React basic by Yoav Amit, Wix
Chen Lerner
 
Asp.NET Handlers and Modules
Asp.NET Handlers and ModulesAsp.NET Handlers and Modules
Asp.NET Handlers and Modules
py_sunil
 
Drupalcon 2021 - Nuxt.js for drupal developers
Drupalcon 2021 - Nuxt.js for drupal developersDrupalcon 2021 - Nuxt.js for drupal developers
Drupalcon 2021 - Nuxt.js for drupal developers
nuppla
 
An approach to responsive, realtime with Backbone.js and WebSockets
An approach to responsive, realtime with Backbone.js and WebSocketsAn approach to responsive, realtime with Backbone.js and WebSockets
An approach to responsive, realtime with Backbone.js and WebSockets
Andrei Sebastian Cîmpean
 
Bundling your front-end with Webpack
Bundling your front-end with WebpackBundling your front-end with Webpack
Bundling your front-end with Webpack
Danillo Corvalan
 
Adobe AEM for Business Heads
Adobe AEM for Business HeadsAdobe AEM for Business Heads
Adobe AEM for Business Heads
Yash Mody
 
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
SenchaCon 2016: Building Enterprise Ext JS Apps with Mavenized Sencha Cmd - F...
Sencha
 
Bundle your modules with Webpack
Bundle your modules with WebpackBundle your modules with Webpack
Bundle your modules with Webpack
Jake Peyser
 
[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS
[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS
[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS
Srijan Technologies
 
Nuxt.JS Introdruction
Nuxt.JS IntrodructionNuxt.JS Introdruction
Nuxt.JS Introdruction
David Ličen
 
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and ToolingSencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha
 
Packing for the Web with Webpack
Packing for the Web with WebpackPacking for the Web with Webpack
Packing for the Web with Webpack
Thiago Temple
 
React basic by Yoav Amit, Wix
React basic by Yoav Amit, Wix React basic by Yoav Amit, Wix
React basic by Yoav Amit, Wix
Chen Lerner
 
Asp.NET Handlers and Modules
Asp.NET Handlers and ModulesAsp.NET Handlers and Modules
Asp.NET Handlers and Modules
py_sunil
 
Drupalcon 2021 - Nuxt.js for drupal developers
Drupalcon 2021 - Nuxt.js for drupal developersDrupalcon 2021 - Nuxt.js for drupal developers
Drupalcon 2021 - Nuxt.js for drupal developers
nuppla
 
An approach to responsive, realtime with Backbone.js and WebSockets
An approach to responsive, realtime with Backbone.js and WebSocketsAn approach to responsive, realtime with Backbone.js and WebSockets
An approach to responsive, realtime with Backbone.js and WebSockets
Andrei Sebastian Cîmpean
 
Bundling your front-end with Webpack
Bundling your front-end with WebpackBundling your front-end with Webpack
Bundling your front-end with Webpack
Danillo Corvalan
 

Similar to Drupal & AngularJS - DrupalCamp Spain 2014 (20)

Drupalcon Mumbai
Drupalcon MumbaiDrupalcon Mumbai
Drupalcon Mumbai
Sumit Kataria
 
angularjs_tutorial.docx
angularjs_tutorial.docxangularjs_tutorial.docx
angularjs_tutorial.docx
telegramvip
 
Angular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaAngular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad india
php2ranjan
 
AngularJS in Production (CTO Forum)
AngularJS in Production (CTO Forum)AngularJS in Production (CTO Forum)
AngularJS in Production (CTO Forum)
Alex Ross
 
A Big Picture Of AngularJS
A Big Picture Of AngularJSA Big Picture Of AngularJS
A Big Picture Of AngularJS
Nitin Pandit
 
Angular js workshop
Angular js workshopAngular js workshop
Angular js workshop
Rolands Krumbergs
 
Training On Angular Js
Training On Angular JsTraining On Angular Js
Training On Angular Js
Mahima Radhakrishnan
 
AngularJS By Vipin
AngularJS By VipinAngularJS By Vipin
AngularJS By Vipin
Vipin Mundayad
 
Umbraco Cape Town Meetup Presentation
Umbraco Cape Town Meetup PresentationUmbraco Cape Town Meetup Presentation
Umbraco Cape Town Meetup Presentation
Bluegrass Digital
 
Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to Angularjs
Gaurav Agrawal
 
AngularJS - A Powerful Framework For Web Applications
AngularJS - A Powerful Framework For Web ApplicationsAngularJS - A Powerful Framework For Web Applications
AngularJS - A Powerful Framework For Web Applications
Idexcel Technologies
 
Beginning MEAN Stack
Beginning MEAN StackBeginning MEAN Stack
Beginning MEAN Stack
Rob Davarnia
 
Angular tutorial
Angular tutorialAngular tutorial
Angular tutorial
Rohit Gupta
 
What is mean stack?
What is mean stack?What is mean stack?
What is mean stack?
Rishabh Saxena
 
AngularJS: Overview & Key Features
AngularJS: Overview & Key FeaturesAngularJS: Overview & Key Features
AngularJS: Overview & Key Features
Mohamad Al Asmar
 
Angular js mobile jsday 2014 - Verona 14 may
Angular js mobile   jsday 2014 - Verona 14 mayAngular js mobile   jsday 2014 - Verona 14 may
Angular js mobile jsday 2014 - Verona 14 may
Luciano Amodio
 
Building reusable components as micro frontends with glimmer js and webcompo...
Building reusable components as micro frontends  with glimmer js and webcompo...Building reusable components as micro frontends  with glimmer js and webcompo...
Building reusable components as micro frontends with glimmer js and webcompo...
Andrei Sebastian Cîmpean
 
Cross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic FrameworkCross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic Framework
Troy Miles
 
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.
 
Javascript frameworks
Javascript frameworksJavascript frameworks
Javascript frameworks
RajkumarJangid7
 
angularjs_tutorial.docx
angularjs_tutorial.docxangularjs_tutorial.docx
angularjs_tutorial.docx
telegramvip
 
Angular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaAngular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad india
php2ranjan
 
AngularJS in Production (CTO Forum)
AngularJS in Production (CTO Forum)AngularJS in Production (CTO Forum)
AngularJS in Production (CTO Forum)
Alex Ross
 
A Big Picture Of AngularJS
A Big Picture Of AngularJSA Big Picture Of AngularJS
A Big Picture Of AngularJS
Nitin Pandit
 
Umbraco Cape Town Meetup Presentation
Umbraco Cape Town Meetup PresentationUmbraco Cape Town Meetup Presentation
Umbraco Cape Town Meetup Presentation
Bluegrass Digital
 
Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to Angularjs
Gaurav Agrawal
 
AngularJS - A Powerful Framework For Web Applications
AngularJS - A Powerful Framework For Web ApplicationsAngularJS - A Powerful Framework For Web Applications
AngularJS - A Powerful Framework For Web Applications
Idexcel Technologies
 
Beginning MEAN Stack
Beginning MEAN StackBeginning MEAN Stack
Beginning MEAN Stack
Rob Davarnia
 
Angular tutorial
Angular tutorialAngular tutorial
Angular tutorial
Rohit Gupta
 
AngularJS: Overview & Key Features
AngularJS: Overview & Key FeaturesAngularJS: Overview & Key Features
AngularJS: Overview & Key Features
Mohamad Al Asmar
 
Angular js mobile jsday 2014 - Verona 14 may
Angular js mobile   jsday 2014 - Verona 14 mayAngular js mobile   jsday 2014 - Verona 14 may
Angular js mobile jsday 2014 - Verona 14 may
Luciano Amodio
 
Building reusable components as micro frontends with glimmer js and webcompo...
Building reusable components as micro frontends  with glimmer js and webcompo...Building reusable components as micro frontends  with glimmer js and webcompo...
Building reusable components as micro frontends with glimmer js and webcompo...
Andrei Sebastian Cîmpean
 
Cross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic FrameworkCross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic Framework
Troy Miles
 
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.
 

More from Juampy NR (12)

GitHub Pull Request Builder for Drupal
GitHub Pull Request Builder for DrupalGitHub Pull Request Builder for Drupal
GitHub Pull Request Builder for Drupal
Juampy NR
 
Por qué Drupal es un potente gestor de contenidos
Por qué Drupal es un potente gestor de contenidosPor qué Drupal es un potente gestor de contenidos
Por qué Drupal es un potente gestor de contenidos
Juampy NR
 
Authentication in Drupal 8 - DrupalCamp Spain 2014
Authentication in Drupal 8 - DrupalCamp Spain 2014Authentication in Drupal 8 - DrupalCamp Spain 2014
Authentication in Drupal 8 - DrupalCamp Spain 2014
Juampy NR
 
Trabajar en una empresa distribuida - DrupalCamp Mexico 2014
Trabajar en una empresa distribuida - DrupalCamp Mexico 2014Trabajar en una empresa distribuida - DrupalCamp Mexico 2014
Trabajar en una empresa distribuida - DrupalCamp Mexico 2014
Juampy NR
 
Drupal 8 Authentication
Drupal 8 AuthenticationDrupal 8 Authentication
Drupal 8 Authentication
Juampy NR
 
Symfony y Drupal - Drupal Day Santander 2013
Symfony y Drupal - Drupal Day Santander 2013Symfony y Drupal - Drupal Day Santander 2013
Symfony y Drupal - Drupal Day Santander 2013
Juampy NR
 
Symfony y Drupal
Symfony y DrupalSymfony y Drupal
Symfony y Drupal
Juampy NR
 
Git y drupal
Git y drupalGit y drupal
Git y drupal
Juampy NR
 
Learn through the issue queue
Learn through the issue queueLearn through the issue queue
Learn through the issue queue
Juampy NR
 
Drush workshop
Drush workshopDrush workshop
Drush workshop
Juampy NR
 
Taller de Simpletest - Drupal Day Valencia 2012
Taller de Simpletest - Drupal Day Valencia 2012Taller de Simpletest - Drupal Day Valencia 2012
Taller de Simpletest - Drupal Day Valencia 2012
Juampy NR
 
Aegir: un Drupal para gobernarlos a todos
Aegir: un Drupal para gobernarlos a todosAegir: un Drupal para gobernarlos a todos
Aegir: un Drupal para gobernarlos a todos
Juampy NR
 
GitHub Pull Request Builder for Drupal
GitHub Pull Request Builder for DrupalGitHub Pull Request Builder for Drupal
GitHub Pull Request Builder for Drupal
Juampy NR
 
Por qué Drupal es un potente gestor de contenidos
Por qué Drupal es un potente gestor de contenidosPor qué Drupal es un potente gestor de contenidos
Por qué Drupal es un potente gestor de contenidos
Juampy NR
 
Authentication in Drupal 8 - DrupalCamp Spain 2014
Authentication in Drupal 8 - DrupalCamp Spain 2014Authentication in Drupal 8 - DrupalCamp Spain 2014
Authentication in Drupal 8 - DrupalCamp Spain 2014
Juampy NR
 
Trabajar en una empresa distribuida - DrupalCamp Mexico 2014
Trabajar en una empresa distribuida - DrupalCamp Mexico 2014Trabajar en una empresa distribuida - DrupalCamp Mexico 2014
Trabajar en una empresa distribuida - DrupalCamp Mexico 2014
Juampy NR
 
Drupal 8 Authentication
Drupal 8 AuthenticationDrupal 8 Authentication
Drupal 8 Authentication
Juampy NR
 
Symfony y Drupal - Drupal Day Santander 2013
Symfony y Drupal - Drupal Day Santander 2013Symfony y Drupal - Drupal Day Santander 2013
Symfony y Drupal - Drupal Day Santander 2013
Juampy NR
 
Symfony y Drupal
Symfony y DrupalSymfony y Drupal
Symfony y Drupal
Juampy NR
 
Git y drupal
Git y drupalGit y drupal
Git y drupal
Juampy NR
 
Learn through the issue queue
Learn through the issue queueLearn through the issue queue
Learn through the issue queue
Juampy NR
 
Drush workshop
Drush workshopDrush workshop
Drush workshop
Juampy NR
 
Taller de Simpletest - Drupal Day Valencia 2012
Taller de Simpletest - Drupal Day Valencia 2012Taller de Simpletest - Drupal Day Valencia 2012
Taller de Simpletest - Drupal Day Valencia 2012
Juampy NR
 
Aegir: un Drupal para gobernarlos a todos
Aegir: un Drupal para gobernarlos a todosAegir: un Drupal para gobernarlos a todos
Aegir: un Drupal para gobernarlos a todos
Juampy NR
 

Recently uploaded (19)

Reliable Vancouver Web Hosting with Local Servers & 24/7 Support
Reliable Vancouver Web Hosting with Local Servers & 24/7 SupportReliable Vancouver Web Hosting with Local Servers & 24/7 Support
Reliable Vancouver Web Hosting with Local Servers & 24/7 Support
steve198109
 
5-Proses-proses Akuisisi Citra Digital.pptx
5-Proses-proses Akuisisi Citra Digital.pptx5-Proses-proses Akuisisi Citra Digital.pptx
5-Proses-proses Akuisisi Citra Digital.pptx
andani26
 
DNS Resolvers and Nameservers (in New Zealand)
DNS Resolvers and Nameservers (in New Zealand)DNS Resolvers and Nameservers (in New Zealand)
DNS Resolvers and Nameservers (in New Zealand)
APNIC
 
White and Red Clean Car Business Pitch Presentation.pptx
White and Red Clean Car Business Pitch Presentation.pptxWhite and Red Clean Car Business Pitch Presentation.pptx
White and Red Clean Car Business Pitch Presentation.pptx
canumatown
 
Perguntas dos animais - Slides ilustrados de múltipla escolha
Perguntas dos animais - Slides ilustrados de múltipla escolhaPerguntas dos animais - Slides ilustrados de múltipla escolha
Perguntas dos animais - Slides ilustrados de múltipla escolha
socaslev
 
Smart Mobile App Pitch Deck丨AI Travel App Presentation Template
Smart Mobile App Pitch Deck丨AI Travel App Presentation TemplateSmart Mobile App Pitch Deck丨AI Travel App Presentation Template
Smart Mobile App Pitch Deck丨AI Travel App Presentation Template
yojeari421237
 
Understanding the Tor Network and Exploring the Deep Web
Understanding the Tor Network and Exploring the Deep WebUnderstanding the Tor Network and Exploring the Deep Web
Understanding the Tor Network and Exploring the Deep Web
nabilajabin35
 
Determining Glass is mechanical textile
Determining  Glass is mechanical textileDetermining  Glass is mechanical textile
Determining Glass is mechanical textile
Azizul Hakim
 
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHostingTop Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
steve198109
 
Computers Networks Computers Networks Computers Networks
Computers Networks Computers Networks Computers NetworksComputers Networks Computers Networks Computers Networks
Computers Networks Computers Networks Computers Networks
Tito208863
 
project_based_laaaaaaaaaaearning,kelompok 10.pptx
project_based_laaaaaaaaaaearning,kelompok 10.pptxproject_based_laaaaaaaaaaearning,kelompok 10.pptx
project_based_laaaaaaaaaaearning,kelompok 10.pptx
redzuriel13
 
(Hosting PHising Sites) for Cryptography and network security
(Hosting PHising Sites) for Cryptography and network security(Hosting PHising Sites) for Cryptography and network security
(Hosting PHising Sites) for Cryptography and network security
aluacharya169
 
highend-srxseries-services-gateways-customer-presentation.pptx
highend-srxseries-services-gateways-customer-presentation.pptxhighend-srxseries-services-gateways-customer-presentation.pptx
highend-srxseries-services-gateways-customer-presentation.pptx
elhadjcheikhdiop
 
APNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC Update, presented at NZNOG 2025 by Terry SweetserAPNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC
 
OSI TCP IP Protocol Layers description f
OSI TCP IP Protocol Layers description fOSI TCP IP Protocol Layers description f
OSI TCP IP Protocol Layers description f
cbr49917
 
Best web hosting Vancouver 2025 for you business
Best web hosting Vancouver 2025 for you businessBest web hosting Vancouver 2025 for you business
Best web hosting Vancouver 2025 for you business
steve198109
 
Mobile database for your company telemarketing or sms marketing campaigns. Fr...
Mobile database for your company telemarketing or sms marketing campaigns. Fr...Mobile database for your company telemarketing or sms marketing campaigns. Fr...
Mobile database for your company telemarketing or sms marketing campaigns. Fr...
DataProvider1
 
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC
 
IT Services Workflow From Request to Resolution
IT Services Workflow From Request to ResolutionIT Services Workflow From Request to Resolution
IT Services Workflow From Request to Resolution
mzmziiskd
 
Reliable Vancouver Web Hosting with Local Servers & 24/7 Support
Reliable Vancouver Web Hosting with Local Servers & 24/7 SupportReliable Vancouver Web Hosting with Local Servers & 24/7 Support
Reliable Vancouver Web Hosting with Local Servers & 24/7 Support
steve198109
 
5-Proses-proses Akuisisi Citra Digital.pptx
5-Proses-proses Akuisisi Citra Digital.pptx5-Proses-proses Akuisisi Citra Digital.pptx
5-Proses-proses Akuisisi Citra Digital.pptx
andani26
 
DNS Resolvers and Nameservers (in New Zealand)
DNS Resolvers and Nameservers (in New Zealand)DNS Resolvers and Nameservers (in New Zealand)
DNS Resolvers and Nameservers (in New Zealand)
APNIC
 
White and Red Clean Car Business Pitch Presentation.pptx
White and Red Clean Car Business Pitch Presentation.pptxWhite and Red Clean Car Business Pitch Presentation.pptx
White and Red Clean Car Business Pitch Presentation.pptx
canumatown
 
Perguntas dos animais - Slides ilustrados de múltipla escolha
Perguntas dos animais - Slides ilustrados de múltipla escolhaPerguntas dos animais - Slides ilustrados de múltipla escolha
Perguntas dos animais - Slides ilustrados de múltipla escolha
socaslev
 
Smart Mobile App Pitch Deck丨AI Travel App Presentation Template
Smart Mobile App Pitch Deck丨AI Travel App Presentation TemplateSmart Mobile App Pitch Deck丨AI Travel App Presentation Template
Smart Mobile App Pitch Deck丨AI Travel App Presentation Template
yojeari421237
 
Understanding the Tor Network and Exploring the Deep Web
Understanding the Tor Network and Exploring the Deep WebUnderstanding the Tor Network and Exploring the Deep Web
Understanding the Tor Network and Exploring the Deep Web
nabilajabin35
 
Determining Glass is mechanical textile
Determining  Glass is mechanical textileDetermining  Glass is mechanical textile
Determining Glass is mechanical textile
Azizul Hakim
 
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHostingTop Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
steve198109
 
Computers Networks Computers Networks Computers Networks
Computers Networks Computers Networks Computers NetworksComputers Networks Computers Networks Computers Networks
Computers Networks Computers Networks Computers Networks
Tito208863
 
project_based_laaaaaaaaaaearning,kelompok 10.pptx
project_based_laaaaaaaaaaearning,kelompok 10.pptxproject_based_laaaaaaaaaaearning,kelompok 10.pptx
project_based_laaaaaaaaaaearning,kelompok 10.pptx
redzuriel13
 
(Hosting PHising Sites) for Cryptography and network security
(Hosting PHising Sites) for Cryptography and network security(Hosting PHising Sites) for Cryptography and network security
(Hosting PHising Sites) for Cryptography and network security
aluacharya169
 
highend-srxseries-services-gateways-customer-presentation.pptx
highend-srxseries-services-gateways-customer-presentation.pptxhighend-srxseries-services-gateways-customer-presentation.pptx
highend-srxseries-services-gateways-customer-presentation.pptx
elhadjcheikhdiop
 
APNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC Update, presented at NZNOG 2025 by Terry SweetserAPNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC
 
OSI TCP IP Protocol Layers description f
OSI TCP IP Protocol Layers description fOSI TCP IP Protocol Layers description f
OSI TCP IP Protocol Layers description f
cbr49917
 
Best web hosting Vancouver 2025 for you business
Best web hosting Vancouver 2025 for you businessBest web hosting Vancouver 2025 for you business
Best web hosting Vancouver 2025 for you business
steve198109
 
Mobile database for your company telemarketing or sms marketing campaigns. Fr...
Mobile database for your company telemarketing or sms marketing campaigns. Fr...Mobile database for your company telemarketing or sms marketing campaigns. Fr...
Mobile database for your company telemarketing or sms marketing campaigns. Fr...
DataProvider1
 
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC
 
IT Services Workflow From Request to Resolution
IT Services Workflow From Request to ResolutionIT Services Workflow From Request to Resolution
IT Services Workflow From Request to Resolution
mzmziiskd
 

Drupal & AngularJS - DrupalCamp Spain 2014

  • 1. Drupal & AngularJS DrupalCamp Spain 2014 Juampy Novillo Requena Mateu Aguilo Bosh
  • 2. About us (@e0ipso & @juampy72) Drupal enthusiasts Developers at Lullabot
  • 3. Glossary (1) Front end developer / Themer Someone who works in the presentational aspects of a website. Back end developer / Programmer Someone who works in the architecture of a website.
  • 4. Glossary (2) Decouple tr. separate, disengage, or dissociate (something) from something else. For Drupal: move areas of business logic from Drupal to the client using JavaScript.
  • 5. <html> … <div id=”the-js-page”></div> … </html> title: “Ooops”, link: “/search”, image: “img.jpg” Raw data sent to the client. Ooops /search Backend: Drupal Client: Browser
  • 6. ¿Why decoupling? 1. Theming in Drupal is tedious and tricky. 2. As an alternative to ESI in pages delivered by reverse proxies. 3. Easier core upgrades.
  • 7. 1. Theming in Drupal is tedious and tricky Hi themer! Here are hundred of thousands of divs; and the CSS is scattered among these files. Remember that if you touch core I will rip your head off. Good luck! :-D http://a1.s6img.com/cdn/box_004/post_14/539443_1823194_lz.jpg
  • 8. Against ... Hi themer, make a request to the service $http('/mydata.json') in JavaScript in order to obtain the data. You can write your own CSS and HTML from scratch. http://www.vote29.com/newmyblog/wp-content/uploads/2012/09/moka-happy-dog3.jpg
  • 9. 2. As an alternative to ESI in pages delivered by reverse proxies Given a page, allow that certain areas are dynamic but keep the rest been delivered by a reverse proxy like Varnish.
  • 10. AngularJS fetches the data and renders the header. Drupal + Varnish take care of the rest of the page.
  • 11. Same header embedded in a different site Assync calls to different servers: - Data server - Server with the AngularJS app
  • 12. 3. Easier core upgrades @daniel_jacobson, ex CTO at National Public Radio (www.npr.org). Built a backend system which offered an API to several client applications. This backend system has been on for 12 years. http://blog.programmableweb.com/2009/10/13/cope-create-once-publish-everywhere
  • 13. As long as we respect the structure of the APIs being consumed by client apps, the backend can evolve.
  • 14. AngularJS is an MVC JavaScript framework which elegantly separates controller, business and model logic in your application.
  • 15. AngularJS basics: directive A Directive is a marker on a DOM element that tell AngularJS's HTML compiler to attach a specified behavior to that DOM element. http://jsfiddle.net/e0ipso/9eXD9/ LIVE DEMO
  • 16. AngularJS basics (2): controller A Controller is a JavaScript constructor function that is used to augment the Angular Scope. LIVE DEMO http://jsfiddle.net/e0ipso/t2N8b/2/
  • 17. 2-way data binding The view can update the model and the model can update the view. Out of the box. LIVE DEMO http://jsfiddle.net/e0ipso/PF3cP/1/
  • 18. ¿What about JQuery & Backbone? There is no MVC separation as in AngularJS in JQuery and Backbone. They both lack 2-way data binding. Example in AngularJS / jQuery / Backbone.
  • 19. Full example: contact form Source article