SlideShare une entreprise Scribd logo
1  sur  28
Télécharger pour lire hors ligne
Best Practices
From Nutshell To Awesome Thing
By HenryTao – http://henrytao.me – version 2.0
henrytao-me/angular-best-practices
By HenryTao – http://henrytao.me
Github
Agenda
¡  Who I Am? Why Do I Choose AngularJS?
¡  AngularJS – The BEST World.
¡  AngularJS – The DARK World.
¡  AngularJS Best Practices – The 3rd World.
¡  The Future Of AngularJS.
¡  Resources & References.
By HenryTao – http://henrytao.me
Who I Am?
Technical lover.
Love to build awesome product.
Passion about Entrepreneur-Ship.
Believe that we can make a better world.
Keep dreaming – Keep acting – Be realistic.
Co-founder, Front-end developer at Coral.io – Making scene of data
By HenryTao – http://henrytao.me
Why Do I Choose AngularJS?
Reusable Component
||
html + css + js
By HenryTao – http://henrytao.me
Why Do I Choose AngularJS?
By HenryTao – http://henrytao.me
PROBLEM!
!
.component .element{!
/* To-do */!
}!
!
$(‘.component .element’).trigger(‘click’);!
COMMON SOLUTION!
.component > .element{!
/* To-do */!
}!
!
$(‘.component > .element’).trigger(‘click’);!
Why Do I Choose AngularJS?
By HenryTao – http://henrytao.me
meteor.com
derbyjs.com
polymer-project.org
angularjs.org
backbonejs.org
Why Do I Choose AngularJS?
By HenryTao – http://henrytao.me
Testing
people often don’t know what they don’t know
people don’t feel they have a problem
until they understand the problem
the beauty of CI – Continuous Integration
AngularJS – The BEST World.
By HenryTao – http://henrytao.me
I found you
AngularJS – The BEST World.
2 ways data binding
By HenryTao – http://henrytao.me
directive
testing
template
routing
service
factory
dependency injection
SPAs
AngularJS – The BEST World.
By HenryTao – http://henrytao.me
BASIC 2 WAYS DATA BINDING!
!
// html!
Hello {{username}}!!
!
// js!
$scope.username = ‘John Doe’;!
// html!
Hello John Doe!!
!
// html!
<input ng-model="username”>!
!
AngularJS – The BEST World.
By HenryTao – http://henrytao.me
BASIC DIRECTIVE!
!
// html element!
<a href=‘http://angularjs.org’>html element</a>!
!
// custom attribute directive!
<a ng-href=‘http://{{address}}’>html element</a>!
!
!
AngularJS – The DARK World.
By HenryTao – http://henrytao.me
AngularJS – The DARK World.
Over 2.500 data-binding
By HenryTao – http://henrytao.me
e2e testing with angular ui-router
too many template file
authentication
SEO
reusable code
DOM
AngularJS Best Practices – The 3rd World.
By HenryTao – http://henrytao.me
Sooooo Excited
AngularJS Best Practices – The 3rd World.
By HenryTao – http://henrytao.me
Over 2.500 data-binding
Use pagination
Never binding function
Cache data with _.memoize
Use module ux-angularjs-datagrid
Use ng-if instead of ng-show
AngularJS Best Practices – The 3rd World.
By HenryTao – http://henrytao.me
e2e testing with angular ui-router
Angular ui-router still not work perfect
with e2e testing
Setup protractor with selenium support
Use ghostdriver headless browser
(phantomjs) on CI
Consider casperjs for e2e testing
AngularJS Best Practices – The 3rd World.
By HenryTao – http://henrytao.me
too many template file
Use angular template cache
Convert all html template into javascript
AngularJS Best Practices – The 3rd World.
By HenryTao – http://henrytao.me
DOM
Inject $window & $document
Add jQuery before Angular
AngularJS Best Practices – The 3rd World.
By HenryTao – http://henrytao.me
authentication
Use $httpProvider.responseInterceptors
AngularJS Best Practices – The 3rd World.
By HenryTao – http://henrytao.me
reusable code
Code structure
Use ng-boilerplate or ng-boilerplate-2
Use grunt / gulp for development life cycle
AngularJS Best Practices – The 3rd World.
MVC vs Module
By HenryTao – http://henrytao.me
AngularJS Best Practices – The 3rd World.
By HenryTao – http://henrytao.me
seo
pre-render with phantomjs
	
  
http://localhost/#!/routing/to/somewhere	
  
http://localhost/?_escaped_fragment_=/routing/to/somewhere	
  
looking for something cool in the future
Prerender.io
Brombone.com
By HenryTao – http://henrytao.me
è Re-structure ng-boilerplate.
è Use module approach.
è Communicate through API.
è Frontend: AWS S3 / NodeJS …
è Backend: Java.
è grunt, bower, less, uglify, jshint, cssmin,
htmlmin, watch, livereload, usemin, ngmin,
protractor, selenium webdriver, mocha,
phantomjs.
Coral.io solution
What’s Next With Angular 2.0?
¡  Airbnb – Rendr
Backbone in apps in the browser and Node.
¡  jQuery on nodejs with cheerio
¡  Polymer-project
Web component
¡  AngularJS 2.0
Server-side prerendering
Simplify directive
Animation
By HenryTao – http://henrytao.me
Resources & References
¡  AngularJS style guide (see here)
¡  Best practices from father of AngularJS (see here)
¡  ng-boilerplate (see here)
¡  Airbnb prerender backbone (see here)
¡  AngularSEO from yearofmoo (see here)
¡  AngularJS full testing with Karma from yearofmoo (see here)
¡  AngularJS Video from egghead.io (see here)
¡  AngularJS Best Practices – offically (see here)
¡  AngularJS Experiment (see here)
By HenryTao – http://henrytao.me All images were got from http://google.com
Resources & References
By HenryTao – http://henrytao.me
Resources & References
By HenryTao – http://henrytao.me

Contenu connexe

Tendances

Angular js tutorial slides
Angular js tutorial slidesAngular js tutorial slides
Angular js tutorial slidessamhelman
 
AngularJS Basics and Best Practices - CC FE &UX
AngularJS Basics and Best Practices - CC FE &UXAngularJS Basics and Best Practices - CC FE &UX
AngularJS Basics and Best Practices - CC FE &UXJWORKS powered by Ordina
 
Up & running with ECMAScript6
Up & running with ECMAScript6Up & running with ECMAScript6
Up & running with ECMAScript6Nir Kaufman
 
AngularJS application architecture
AngularJS application architectureAngularJS application architecture
AngularJS application architectureGabriele Falace
 
The Art of AngularJS - DeRailed 2014
The Art of AngularJS - DeRailed 2014The Art of AngularJS - DeRailed 2014
The Art of AngularJS - DeRailed 2014Matt Raible
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJSAldo Pizzagalli
 
Tek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJSTek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJSPablo Godel
 
Introduction to Angular js 2.0
Introduction to Angular js 2.0Introduction to Angular js 2.0
Introduction to Angular js 2.0Nagaraju Sangam
 
AngularJS - Architecture decisions in a large project 
AngularJS - Architecture decisionsin a large project AngularJS - Architecture decisionsin a large project 
AngularJS - Architecture decisions in a large project Elad Hirsch
 
Angularjs - lazy loading techniques
Angularjs - lazy loading techniques Angularjs - lazy loading techniques
Angularjs - lazy loading techniques Nir Kaufman
 
Angular 2 overview
Angular 2 overviewAngular 2 overview
Angular 2 overviewJesse Warden
 
Introduction to Angular 2
Introduction to Angular 2Introduction to Angular 2
Introduction to Angular 2Trung Vo Tuan
 
Angular js - 10 reasons to choose angularjs
Angular js - 10 reasons to choose angularjs Angular js - 10 reasons to choose angularjs
Angular js - 10 reasons to choose angularjs Nir Kaufman
 
Getting Started with Angular 2
Getting Started with Angular 2Getting Started with Angular 2
Getting Started with Angular 2FITC
 
Overview about AngularJS Framework
Overview about AngularJS Framework Overview about AngularJS Framework
Overview about AngularJS Framework Camilo Lopes
 
Angular js vs. Facebook react
Angular js vs. Facebook reactAngular js vs. Facebook react
Angular js vs. Facebook reactKeyup
 

Tendances (20)

Angular js tutorial slides
Angular js tutorial slidesAngular js tutorial slides
Angular js tutorial slides
 
AngularJS Basics and Best Practices - CC FE &UX
AngularJS Basics and Best Practices - CC FE &UXAngularJS Basics and Best Practices - CC FE &UX
AngularJS Basics and Best Practices - CC FE &UX
 
Up & running with ECMAScript6
Up & running with ECMAScript6Up & running with ECMAScript6
Up & running with ECMAScript6
 
AngularJS application architecture
AngularJS application architectureAngularJS application architecture
AngularJS application architecture
 
The Art of AngularJS - DeRailed 2014
The Art of AngularJS - DeRailed 2014The Art of AngularJS - DeRailed 2014
The Art of AngularJS - DeRailed 2014
 
AngularJS Best Practices
AngularJS Best PracticesAngularJS Best Practices
AngularJS Best Practices
 
AngularJs advanced Topics
AngularJs advanced TopicsAngularJs advanced Topics
AngularJs advanced Topics
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Tek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJSTek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJS
 
Introduction to Angular js 2.0
Introduction to Angular js 2.0Introduction to Angular js 2.0
Introduction to Angular js 2.0
 
AngularJS - Architecture decisions in a large project 
AngularJS - Architecture decisionsin a large project AngularJS - Architecture decisionsin a large project 
AngularJS - Architecture decisions in a large project 
 
Angularjs - lazy loading techniques
Angularjs - lazy loading techniques Angularjs - lazy loading techniques
Angularjs - lazy loading techniques
 
Angular js slides
Angular js slidesAngular js slides
Angular js slides
 
Angular 2 overview
Angular 2 overviewAngular 2 overview
Angular 2 overview
 
Introduction to Angular 2
Introduction to Angular 2Introduction to Angular 2
Introduction to Angular 2
 
Angular js - 10 reasons to choose angularjs
Angular js - 10 reasons to choose angularjs Angular js - 10 reasons to choose angularjs
Angular js - 10 reasons to choose angularjs
 
Getting Started with Angular 2
Getting Started with Angular 2Getting Started with Angular 2
Getting Started with Angular 2
 
Overview about AngularJS Framework
Overview about AngularJS Framework Overview about AngularJS Framework
Overview about AngularJS Framework
 
AngularJS is awesome
AngularJS is awesomeAngularJS is awesome
AngularJS is awesome
 
Angular js vs. Facebook react
Angular js vs. Facebook reactAngular js vs. Facebook react
Angular js vs. Facebook react
 

Similaire à Angular Best Practices v2

Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...Matt Raible
 
Front End Development for Back End Developers - vJUG24 2017
Front End Development for Back End Developers - vJUG24 2017Front End Development for Back End Developers - vJUG24 2017
Front End Development for Back End Developers - vJUG24 2017Matt Raible
 
Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Matt Raible
 
Velocity EU 2012 - Third party scripts and you
Velocity EU 2012 - Third party scripts and youVelocity EU 2012 - Third party scripts and you
Velocity EU 2012 - Third party scripts and youPatrick Meenan
 
Ionic - Revolutionizing Hybrid Mobile Application Development
Ionic - Revolutionizing Hybrid Mobile Application DevelopmentIonic - Revolutionizing Hybrid Mobile Application Development
Ionic - Revolutionizing Hybrid Mobile Application DevelopmentJustin James
 
NHibernate from inside
NHibernate from insideNHibernate from inside
NHibernate from insideAndriy Buday
 
Developing web applications in 2010
Developing web applications in 2010Developing web applications in 2010
Developing web applications in 2010Ignacio Coloma
 
Introduction to Angular 2
Introduction to Angular 2Introduction to Angular 2
Introduction to Angular 2Naveen Pete
 
Web Development in Django
Web Development in DjangoWeb Development in Django
Web Development in DjangoLakshman Prasad
 
Deep crawl the chaotic landscape of JavaScript
Deep crawl the chaotic landscape of JavaScript Deep crawl the chaotic landscape of JavaScript
Deep crawl the chaotic landscape of JavaScript Onely
 
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
 
Create responsive websites with Django, REST and AngularJS
Create responsive websites with Django, REST and AngularJSCreate responsive websites with Django, REST and AngularJS
Create responsive websites with Django, REST and AngularJSHannes Hapke
 
Building the Front End with AngularJS
Building the Front End with AngularJSBuilding the Front End with AngularJS
Building the Front End with AngularJSJohn Ennew
 
Search Engine Spiders
Search Engine SpidersSearch Engine Spiders
Search Engine SpidersCJ Jenkins
 
Hacking the browser with puppeteer sharp .NET conf AR 2018
Hacking the browser with puppeteer sharp .NET conf AR 2018Hacking the browser with puppeteer sharp .NET conf AR 2018
Hacking the browser with puppeteer sharp .NET conf AR 2018Darío Kondratiuk
 
Introduction To Django
Introduction To DjangoIntroduction To Django
Introduction To DjangoJay Graves
 
Learn Angular 9/8 In Easy Steps
Learn Angular 9/8 In Easy Steps Learn Angular 9/8 In Easy Steps
Learn Angular 9/8 In Easy Steps Ahmed Bouchefra
 

Similaire à Angular Best Practices v2 (20)

Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
 
Front End Development for Back End Developers - vJUG24 2017
Front End Development for Back End Developers - vJUG24 2017Front End Development for Back End Developers - vJUG24 2017
Front End Development for Back End Developers - vJUG24 2017
 
Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017
 
Velocity EU 2012 - Third party scripts and you
Velocity EU 2012 - Third party scripts and youVelocity EU 2012 - Third party scripts and you
Velocity EU 2012 - Third party scripts and you
 
Ionic - Revolutionizing Hybrid Mobile Application Development
Ionic - Revolutionizing Hybrid Mobile Application DevelopmentIonic - Revolutionizing Hybrid Mobile Application Development
Ionic - Revolutionizing Hybrid Mobile Application Development
 
Don't screw it up! How to build durable API
Don't screw it up! How to build durable API Don't screw it up! How to build durable API
Don't screw it up! How to build durable API
 
NHibernate from inside
NHibernate from insideNHibernate from inside
NHibernate from inside
 
Developing web applications in 2010
Developing web applications in 2010Developing web applications in 2010
Developing web applications in 2010
 
Introduction to Angular 2
Introduction to Angular 2Introduction to Angular 2
Introduction to Angular 2
 
Web Development in Django
Web Development in DjangoWeb Development in Django
Web Development in Django
 
Deep crawl the chaotic landscape of JavaScript
Deep crawl the chaotic landscape of JavaScript Deep crawl the chaotic landscape of JavaScript
Deep crawl the chaotic landscape of JavaScript
 
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
 
Create responsive websites with Django, REST and AngularJS
Create responsive websites with Django, REST and AngularJSCreate responsive websites with Django, REST and AngularJS
Create responsive websites with Django, REST and AngularJS
 
Building the Front End with AngularJS
Building the Front End with AngularJSBuilding the Front End with AngularJS
Building the Front End with AngularJS
 
Introduce Django
Introduce DjangoIntroduce Django
Introduce Django
 
I18n of java script
I18n of java scriptI18n of java script
I18n of java script
 
Search Engine Spiders
Search Engine SpidersSearch Engine Spiders
Search Engine Spiders
 
Hacking the browser with puppeteer sharp .NET conf AR 2018
Hacking the browser with puppeteer sharp .NET conf AR 2018Hacking the browser with puppeteer sharp .NET conf AR 2018
Hacking the browser with puppeteer sharp .NET conf AR 2018
 
Introduction To Django
Introduction To DjangoIntroduction To Django
Introduction To Django
 
Learn Angular 9/8 In Easy Steps
Learn Angular 9/8 In Easy Steps Learn Angular 9/8 In Easy Steps
Learn Angular 9/8 In Easy Steps
 

Dernier

Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...BookNet Canada
 

Dernier (20)

Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
 

Angular Best Practices v2

  • 1. Best Practices From Nutshell To Awesome Thing By HenryTao – http://henrytao.me – version 2.0
  • 3. Agenda ¡  Who I Am? Why Do I Choose AngularJS? ¡  AngularJS – The BEST World. ¡  AngularJS – The DARK World. ¡  AngularJS Best Practices – The 3rd World. ¡  The Future Of AngularJS. ¡  Resources & References. By HenryTao – http://henrytao.me
  • 4. Who I Am? Technical lover. Love to build awesome product. Passion about Entrepreneur-Ship. Believe that we can make a better world. Keep dreaming – Keep acting – Be realistic. Co-founder, Front-end developer at Coral.io – Making scene of data By HenryTao – http://henrytao.me
  • 5. Why Do I Choose AngularJS? Reusable Component || html + css + js By HenryTao – http://henrytao.me
  • 6. Why Do I Choose AngularJS? By HenryTao – http://henrytao.me PROBLEM! ! .component .element{! /* To-do */! }! ! $(‘.component .element’).trigger(‘click’);! COMMON SOLUTION! .component > .element{! /* To-do */! }! ! $(‘.component > .element’).trigger(‘click’);!
  • 7. Why Do I Choose AngularJS? By HenryTao – http://henrytao.me meteor.com derbyjs.com polymer-project.org angularjs.org backbonejs.org
  • 8. Why Do I Choose AngularJS? By HenryTao – http://henrytao.me Testing people often don’t know what they don’t know people don’t feel they have a problem until they understand the problem the beauty of CI – Continuous Integration
  • 9. AngularJS – The BEST World. By HenryTao – http://henrytao.me I found you
  • 10. AngularJS – The BEST World. 2 ways data binding By HenryTao – http://henrytao.me directive testing template routing service factory dependency injection SPAs
  • 11. AngularJS – The BEST World. By HenryTao – http://henrytao.me BASIC 2 WAYS DATA BINDING! ! // html! Hello {{username}}!! ! // js! $scope.username = ‘John Doe’;! // html! Hello John Doe!! ! // html! <input ng-model="username”>! !
  • 12. AngularJS – The BEST World. By HenryTao – http://henrytao.me BASIC DIRECTIVE! ! // html element! <a href=‘http://angularjs.org’>html element</a>! ! // custom attribute directive! <a ng-href=‘http://{{address}}’>html element</a>! ! !
  • 13. AngularJS – The DARK World. By HenryTao – http://henrytao.me
  • 14. AngularJS – The DARK World. Over 2.500 data-binding By HenryTao – http://henrytao.me e2e testing with angular ui-router too many template file authentication SEO reusable code DOM
  • 15. AngularJS Best Practices – The 3rd World. By HenryTao – http://henrytao.me Sooooo Excited
  • 16. AngularJS Best Practices – The 3rd World. By HenryTao – http://henrytao.me Over 2.500 data-binding Use pagination Never binding function Cache data with _.memoize Use module ux-angularjs-datagrid Use ng-if instead of ng-show
  • 17. AngularJS Best Practices – The 3rd World. By HenryTao – http://henrytao.me e2e testing with angular ui-router Angular ui-router still not work perfect with e2e testing Setup protractor with selenium support Use ghostdriver headless browser (phantomjs) on CI Consider casperjs for e2e testing
  • 18. AngularJS Best Practices – The 3rd World. By HenryTao – http://henrytao.me too many template file Use angular template cache Convert all html template into javascript
  • 19. AngularJS Best Practices – The 3rd World. By HenryTao – http://henrytao.me DOM Inject $window & $document Add jQuery before Angular
  • 20. AngularJS Best Practices – The 3rd World. By HenryTao – http://henrytao.me authentication Use $httpProvider.responseInterceptors
  • 21. AngularJS Best Practices – The 3rd World. By HenryTao – http://henrytao.me reusable code Code structure Use ng-boilerplate or ng-boilerplate-2 Use grunt / gulp for development life cycle
  • 22. AngularJS Best Practices – The 3rd World. MVC vs Module By HenryTao – http://henrytao.me
  • 23. AngularJS Best Practices – The 3rd World. By HenryTao – http://henrytao.me seo pre-render with phantomjs   http://localhost/#!/routing/to/somewhere   http://localhost/?_escaped_fragment_=/routing/to/somewhere   looking for something cool in the future Prerender.io Brombone.com
  • 24. By HenryTao – http://henrytao.me è Re-structure ng-boilerplate. è Use module approach. è Communicate through API. è Frontend: AWS S3 / NodeJS … è Backend: Java. è grunt, bower, less, uglify, jshint, cssmin, htmlmin, watch, livereload, usemin, ngmin, protractor, selenium webdriver, mocha, phantomjs. Coral.io solution
  • 25. What’s Next With Angular 2.0? ¡  Airbnb – Rendr Backbone in apps in the browser and Node. ¡  jQuery on nodejs with cheerio ¡  Polymer-project Web component ¡  AngularJS 2.0 Server-side prerendering Simplify directive Animation By HenryTao – http://henrytao.me
  • 26. Resources & References ¡  AngularJS style guide (see here) ¡  Best practices from father of AngularJS (see here) ¡  ng-boilerplate (see here) ¡  Airbnb prerender backbone (see here) ¡  AngularSEO from yearofmoo (see here) ¡  AngularJS full testing with Karma from yearofmoo (see here) ¡  AngularJS Video from egghead.io (see here) ¡  AngularJS Best Practices – offically (see here) ¡  AngularJS Experiment (see here) By HenryTao – http://henrytao.me All images were got from http://google.com
  • 27. Resources & References By HenryTao – http://henrytao.me
  • 28. Resources & References By HenryTao – http://henrytao.me