SlideShare a Scribd company logo
1 of 20
March 6, 2014
Andrew Hart
TallyJS
Introduction to frameworks and best practices.
Examples with AngularJS.
About Me:
Studied Chemistry and Math – Graduated in 2013
Partner at Selenko
Front-end engineer and designer using AngularJS
OVERVIEW
• Brief history of JavaScript
• Best Practices
• Module Design Pattern
• AngularJS
POP QUIZ
Which company is credited with inventing JavaScript
• Google
• Amazon
• Netscape
• Mozilla
• Microsoft
POP QUIZ
Which company is credited with inventing JavaScript
• Google
• Amazon
• Netscape – in 1995
• Mozilla
• Microsoft
JavaScript was built by Brenden Eich in 10 days.
EARLY JAVASCRIPT
• Used to manipulate visual elements – EVENT DRIVEN DESIGN
IN 2008, GOOGLE SAID: ‘LET THERE BE V8’
Thanks, Denmark
MODERN DAY JS ENVIRONMENTS
• Browsers
• Servers
• Node.js
• Databases
• MongoDB
• Drones
• Complex 3D Games
• Oculus Rift
• Musical Instruments
• Operating Systems
• Chromium OS
BEST PRACTICES
• Whatever you think is a best practice – AUTOMATE IT - GruntJS
1. JSHint, JSLint
2. Modularize
3. Keep DOM access to a minimum
4. Don’t yield to the browser
5. Testing – Unit Test & e2e
• They’re DRY
• Makes your code easier to maintain, easier to change and easier to read
Why Modules?
• Transcends frameworks and libraries
• It is a way to structure your js code
• Create an anonymous function and execute it immediately
• All of the code that runs inside that function lives in a closure
• Provides: Privacy and State
What is a Module?
MODULE
PLUNKER EXAMPLE
WHAT IS A JAVASCRIPT FRAMEWORK?
• JS had a not-so-good wrap among developers
• Complex handling of browser differences
• jQuery
ANGULARJS
• Open Source JavaScript framework developed
and maintained by Google
• Initial release was in 2009
• Turns HTML in a declarative programming
language ready to serve up dynamic content
through two-way data binding
DESIGN GOALS
• Decouple DOM manipulation from application logic. This improves the testability of
the code.
• Regard application testing as equal in importance to application writing. Testing
difficulty is dramatically affected by the way the code is structured.
• Decouple the client side of an application from the server side. This allows
development work to progress in parallel, and allows for reuse of both sides.
• Guide developers through the entire journey of building an application: from
designing the UI, through writing the business logic, to testing.
FOUR KEY INGREDIENTS
CONTROLLER
• Sets up a new $scope
• An object that represents the application model
• Arranged hierarchically
var myApp = angular.module('myApp',[]);
myApp.controller('GreetingCtrl',
['$scope',function($scope) {
$scope.greeting = 'Hola!';
}]);
Script.js DOM
<div ng-app="myApp">
<div ng-
controller="GreetingCtrl">
{{ greeting }}
</div>
</div>
DIRECTIVE
• DOM things
• Custom elements, class and attributes
• Domain Logic
• There are some powerful directives provided for you
• You can also write your own custom directives – VERY POWERFUL
• Directives can also have their own scope – Plunker Example
• This is where the event listeners are declared
• Must pass everything you need into the directive
SERVICE
• Data things
• Factory Functions – Services are singletons
• Inject Services into Controllers, Directives and even other Services
var myModule = angular.module('myModule', []);
myModule.factory('serviceId', function() {
var shinyNewServiceInstance;
return shinyNewServiceInstance;
});
PUTTING IT ALL TOGETHER
• Plunker Example

More Related Content

What's hot

SharePoint Saturday Utah 2018 - SharePoint Framework, Angular and Azure Funct...
SharePoint Saturday Utah 2018 - SharePoint Framework, Angular and Azure Funct...SharePoint Saturday Utah 2018 - SharePoint Framework, Angular and Azure Funct...
SharePoint Saturday Utah 2018 - SharePoint Framework, Angular and Azure Funct...
Sébastien Levert
 
Improve Your Front-End Project Workflow With Grunt
Improve Your Front-End Project Workflow With GruntImprove Your Front-End Project Workflow With Grunt
Improve Your Front-End Project Workflow With Grunt
Den Odell
 
North American Collaboration Summit 2018 - SharePoint Framework, Angular & Az...
North American Collaboration Summit 2018 - SharePoint Framework, Angular & Az...North American Collaboration Summit 2018 - SharePoint Framework, Angular & Az...
North American Collaboration Summit 2018 - SharePoint Framework, Angular & Az...
Sébastien Levert
 

What's hot (19)

SharePoint Saturday Utah 2018 - SharePoint Framework, Angular and Azure Funct...
SharePoint Saturday Utah 2018 - SharePoint Framework, Angular and Azure Funct...SharePoint Saturday Utah 2018 - SharePoint Framework, Angular and Azure Funct...
SharePoint Saturday Utah 2018 - SharePoint Framework, Angular and Azure Funct...
 
No More Cowboy Coding: Modern WordPress Development Workflow That Scales
No More Cowboy Coding: Modern WordPress Development Workflow That ScalesNo More Cowboy Coding: Modern WordPress Development Workflow That Scales
No More Cowboy Coding: Modern WordPress Development Workflow That Scales
 
Berlin Selenium Meetup - Galen Framework
Berlin Selenium Meetup -  Galen FrameworkBerlin Selenium Meetup -  Galen Framework
Berlin Selenium Meetup - Galen Framework
 
Mean stack
Mean stackMean stack
Mean stack
 
How we use Silverstripe CMS to deliver bilingual and accessible websites
How we use Silverstripe CMS to deliver bilingual and accessible websitesHow we use Silverstripe CMS to deliver bilingual and accessible websites
How we use Silverstripe CMS to deliver bilingual and accessible websites
 
Improve Your Front-End Project Workflow With Grunt
Improve Your Front-End Project Workflow With GruntImprove Your Front-End Project Workflow With Grunt
Improve Your Front-End Project Workflow With Grunt
 
Super tools to boost productivity in React dev env!
Super tools to boost productivity in React dev env!Super tools to boost productivity in React dev env!
Super tools to boost productivity in React dev env!
 
The ABC of Coded Style Guides
The ABC of Coded Style GuidesThe ABC of Coded Style Guides
The ABC of Coded Style Guides
 
Devteach 2017
Devteach 2017Devteach 2017
Devteach 2017
 
Angular 2 vs React
Angular 2 vs ReactAngular 2 vs React
Angular 2 vs React
 
ABC: Angular, Bazel, CLI
ABC: Angular, Bazel, CLIABC: Angular, Bazel, CLI
ABC: Angular, Bazel, CLI
 
North American Collaboration Summit 2018 - SharePoint Framework, Angular & Az...
North American Collaboration Summit 2018 - SharePoint Framework, Angular & Az...North American Collaboration Summit 2018 - SharePoint Framework, Angular & Az...
North American Collaboration Summit 2018 - SharePoint Framework, Angular & Az...
 
Single page App
Single page AppSingle page App
Single page App
 
Hybrid app development frameworks
Hybrid app development frameworksHybrid app development frameworks
Hybrid app development frameworks
 
Vered Flis: Because performance matters! Architecture Next 20
Vered Flis: Because performance matters! Architecture Next 20Vered Flis: Because performance matters! Architecture Next 20
Vered Flis: Because performance matters! Architecture Next 20
 
阳光书屋技术架构介绍
阳光书屋技术架构介绍阳光书屋技术架构介绍
阳光书屋技术架构介绍
 
Advanced AngularJS Tips and Tricks
Advanced AngularJS Tips and TricksAdvanced AngularJS Tips and Tricks
Advanced AngularJS Tips and Tricks
 
How to Successfully Implement Headless Drupal
How to Successfully Implement Headless DrupalHow to Successfully Implement Headless Drupal
How to Successfully Implement Headless Drupal
 
Why Everyone else writes bad code
Why Everyone else writes bad codeWhy Everyone else writes bad code
Why Everyone else writes bad code
 

Viewers also liked (7)

Client Side MVC & Angular
Client Side MVC & AngularClient Side MVC & Angular
Client Side MVC & Angular
 
лек7
лек7лек7
лек7
 
Javascript Client & Server Architectures
Javascript Client & Server ArchitecturesJavascript Client & Server Architectures
Javascript Client & Server Architectures
 
Client side scripting
Client side scriptingClient side scripting
Client side scripting
 
Apresentação angular js
Apresentação angular jsApresentação angular js
Apresentação angular js
 
ORM을 활용할 경우의 설계, 개발 과정
ORM을 활용할 경우의 설계, 개발 과정ORM을 활용할 경우의 설계, 개발 과정
ORM을 활용할 경우의 설계, 개발 과정
 
JavaScript 프레임워크 살펴보기
JavaScript 프레임워크 살펴보기JavaScript 프레임워크 살펴보기
JavaScript 프레임워크 살펴보기
 

Similar to TallyJS #1 - Intro to AngularJS

Narendran Namachivayam
Narendran NamachivayamNarendran Namachivayam
Narendran Namachivayam
Narendran N
 
SadikulIslamDotNetResume
SadikulIslamDotNetResumeSadikulIslamDotNetResume
SadikulIslamDotNetResume
Sadikul Islam
 
Angularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetupAngularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetup
Goutam Dey
 
Net, MVC 3+ years Experience
Net, MVC 3+ years ExperienceNet, MVC 3+ years Experience
Net, MVC 3+ years Experience
Madhava B
 

Similar to TallyJS #1 - Intro to AngularJS (20)

Meetup. Technologies Intro for Non-Tech People
Meetup. Technologies Intro for Non-Tech PeopleMeetup. Technologies Intro for Non-Tech People
Meetup. Technologies Intro for Non-Tech People
 
Internship softwaretraining@ijse
Internship softwaretraining@ijseInternship softwaretraining@ijse
Internship softwaretraining@ijse
 
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and AngularEscaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
 
Narendran Namachivayam
Narendran NamachivayamNarendran Namachivayam
Narendran Namachivayam
 
Mean stack
Mean stackMean stack
Mean stack
 
SadikulIslamDotNetResume
SadikulIslamDotNetResumeSadikulIslamDotNetResume
SadikulIslamDotNetResume
 
Angular JS, A dive to concepts
Angular JS, A dive to conceptsAngular JS, A dive to concepts
Angular JS, A dive to concepts
 
AngularJS in Production (CTO Forum)
AngularJS in Production (CTO Forum)AngularJS in Production (CTO Forum)
AngularJS in Production (CTO Forum)
 
Enterprise Strength Mobile JavaScript
Enterprise Strength Mobile JavaScriptEnterprise Strength Mobile JavaScript
Enterprise Strength Mobile JavaScript
 
FULL stack -> MEAN stack
FULL stack -> MEAN stackFULL stack -> MEAN stack
FULL stack -> MEAN stack
 
Eureko frameworks
Eureko frameworksEureko frameworks
Eureko frameworks
 
Angularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetupAngularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetup
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...
 
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...
 
Curriculum vitae of nguyen hai quy
Curriculum vitae of nguyen hai quyCurriculum vitae of nguyen hai quy
Curriculum vitae of nguyen hai quy
 
Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - Introduction
 
An Introduction to AngularJS
An Introduction to AngularJSAn Introduction to AngularJS
An Introduction to AngularJS
 
Net, MVC 3+ years Experience
Net, MVC 3+ years ExperienceNet, MVC 3+ years Experience
Net, MVC 3+ years Experience
 
Why choose Angular 6?
Why choose Angular 6?Why choose Angular 6?
Why choose Angular 6?
 
SatyaMadhuKiran Software Developer
SatyaMadhuKiran Software DeveloperSatyaMadhuKiran Software Developer
SatyaMadhuKiran Software Developer
 

Recently uploaded

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 

TallyJS #1 - Intro to AngularJS

  • 1. March 6, 2014 Andrew Hart TallyJS Introduction to frameworks and best practices. Examples with AngularJS.
  • 2. About Me: Studied Chemistry and Math – Graduated in 2013 Partner at Selenko Front-end engineer and designer using AngularJS
  • 3. OVERVIEW • Brief history of JavaScript • Best Practices • Module Design Pattern • AngularJS
  • 4. POP QUIZ Which company is credited with inventing JavaScript • Google • Amazon • Netscape • Mozilla • Microsoft
  • 5. POP QUIZ Which company is credited with inventing JavaScript • Google • Amazon • Netscape – in 1995 • Mozilla • Microsoft JavaScript was built by Brenden Eich in 10 days.
  • 6. EARLY JAVASCRIPT • Used to manipulate visual elements – EVENT DRIVEN DESIGN
  • 7. IN 2008, GOOGLE SAID: ‘LET THERE BE V8’ Thanks, Denmark
  • 8. MODERN DAY JS ENVIRONMENTS • Browsers • Servers • Node.js • Databases • MongoDB • Drones • Complex 3D Games • Oculus Rift • Musical Instruments • Operating Systems • Chromium OS
  • 9. BEST PRACTICES • Whatever you think is a best practice – AUTOMATE IT - GruntJS 1. JSHint, JSLint 2. Modularize 3. Keep DOM access to a minimum 4. Don’t yield to the browser 5. Testing – Unit Test & e2e
  • 10. • They’re DRY • Makes your code easier to maintain, easier to change and easier to read Why Modules? • Transcends frameworks and libraries • It is a way to structure your js code • Create an anonymous function and execute it immediately • All of the code that runs inside that function lives in a closure • Provides: Privacy and State What is a Module?
  • 12. WHAT IS A JAVASCRIPT FRAMEWORK? • JS had a not-so-good wrap among developers • Complex handling of browser differences • jQuery
  • 13. ANGULARJS • Open Source JavaScript framework developed and maintained by Google • Initial release was in 2009 • Turns HTML in a declarative programming language ready to serve up dynamic content through two-way data binding
  • 14.
  • 15. DESIGN GOALS • Decouple DOM manipulation from application logic. This improves the testability of the code. • Regard application testing as equal in importance to application writing. Testing difficulty is dramatically affected by the way the code is structured. • Decouple the client side of an application from the server side. This allows development work to progress in parallel, and allows for reuse of both sides. • Guide developers through the entire journey of building an application: from designing the UI, through writing the business logic, to testing.
  • 17. CONTROLLER • Sets up a new $scope • An object that represents the application model • Arranged hierarchically var myApp = angular.module('myApp',[]); myApp.controller('GreetingCtrl', ['$scope',function($scope) { $scope.greeting = 'Hola!'; }]); Script.js DOM <div ng-app="myApp"> <div ng- controller="GreetingCtrl"> {{ greeting }} </div> </div>
  • 18. DIRECTIVE • DOM things • Custom elements, class and attributes • Domain Logic • There are some powerful directives provided for you • You can also write your own custom directives – VERY POWERFUL • Directives can also have their own scope – Plunker Example • This is where the event listeners are declared • Must pass everything you need into the directive
  • 19. SERVICE • Data things • Factory Functions – Services are singletons • Inject Services into Controllers, Directives and even other Services var myModule = angular.module('myModule', []); myModule.factory('serviceId', function() { var shinyNewServiceInstance; return shinyNewServiceInstance; });
  • 20. PUTTING IT ALL TOGETHER • Plunker Example