SlideShare uma empresa Scribd logo
1 de 42
What’s new in Angular 2?
A COMPARISON BETWEEN NG1.X AND NG2
Alfred Jett Grandeza
Founder, Leangineer @ Lean Consulting
leanconsulting.ph | ajgrandeza.com
Lean Consulting
• Davao based start-up
• Founded: February 2016
• Lean Academy SOON!
• More info:
• leanconsulting.ph
• fb.com/leanconsutling.ph
About Me
•Graduate of Ateneo de Davao, Computer Science 2012
•Over 5 years of software engineering experience, .NET and AngularJS
•Former CTO of T.H.E. Patrons
•Co-founder of Lean Consulting/Lean Academy
•Microsoft Technology Associate (2)
•Member of Davao .NET Community (Davao .NET Users Group, Philippine .NET Users Group)
•I do consulting and freelance work from clients overseas
•Advocate of .NET Technologies
•I LOVE TO LEARN!
Prerequisites & Tools
• Required
• JavaScript
• HTML
• CSS
• Helpful
• OOP concepts
• Visual Studio Community
• https://www.visualstudio.com/
• Visual Studio Code
• https://code.visualstudio.com/
Single Page Application
• SPAs are web apps that load a single HTML page and dynamically that page as the user interacts
• Much of the work happen in the client side
• Usually written in JavaScript
SPA Lifecycle
Angular is…
• Open source, JavaScript based front-end framework
• Used for building client-side applications
• MVW Framework (Model-View-Whatever)
• Mainly maintained by Google
Why use Angular?
• Expressive/Customizable HTML
• Powerful Data Binding
• Modular
• Easy back-end integration
Application Demo
• NG 1.X App
• NG 2 App
Key Features of Angular 1.X
• Directives
• Data binding
• Views
• Controllers
• $scope
• Modules
• Dependency Injection
• Routes
• Services
What is a directive?
• Extends HTML attributes, with the prefix “ng-”
• Teaches HTML new tricks
• There are built-in directives
• ng-app
• ng-view
• You can also create your own custom directives
Data Binding
• Interpolation
• {{name}}
• Event Binding
• ng-click=“onClick()”
• Two-way Binding
• <input ng-model=“name” />
Filters & Pipes
• Filters can be added to filter an array
•Pipes can be used to format a data
Views, Controllers, Scope
•View – UI / Display
•Controllers – Controls the logic, data and flow
•$scope is the “glue” between controller and view or the ViewModel
Modules & DI
• A container for the different parts of your Angular app
• You can package code as reusable modules
• You may inject different modules to your module
• Dependency Injection
• Instantiate a module
• ng-app=“”
• Creating a module
• angular.module(‘demoApp’, [])
Routes
• is used for deep-linking URLs to controllers and views
Services
• Are for organizing and share code across your application
Summary for NG1
Key Features
• Directives
• Data binding
• Views
• Controllers
• $scope
• Modules
• Dependency Injection
• Routes
• Services
Angular 2.0
with TypeScript
Live release: Sept 16, 2016
http://angularjs.blogspot.com/2016/09/angular2-final.html
Why Angular 2?
• Built for speed
• Modern
• Simplified API
• Enhanced Productivity
• Develop Across All Platforms
What is TypeScript?
• Open source programming language
• Developed and maintained by Microsoft
• A superset of JavaScript
• Transpiles to plain JavaScript
• Strongly typed
• Class based / OOP approach
• Learn more:
• http://www.typescriptlang.org/Playground
Setting up
• Download
• https://github.com/angular/quickstart
Angular 2 Key Features
• Components
• Templates
• Directives
• Data Binding & Pipes
• Life-cycle hooks
• Services
• Dependency Injection
• Routes
Anatomy of NG 2
Image grabbed from: https://www.pluralsight.com/courses/angular-2-getting-started
Anatomy of a Component
Image grabbed from: https://www.pluralsight.com/courses/angular-2-getting-started
Components
Image grabbed from: https://www.pluralsight.com/courses/angular-2-getting-started
Components
Import statements
Metadata & Template
Class
Decorator
• A function that adds metadata to a class
• Prefixed with an @
• @Component()
Defining a Template in a Component
• Inline template
•Linked Template
Data Binding
• Coordinates communication between the component’s class and template
• Interpolation
• {{name}}
• Event Binding
• (click)=‘onClick()’
• Two-way Binding
• <input [(ngModel)]=‘name’ />
• Property Binding
• <img [src] = ‘customer.thumbnail’ />
Directive in NG2
• Built-in directives
• *ngIf
• *ngFor
Pipes
• | lowercase
• | currency
• | uppercase
• No more filter 
• You have to create your own pipe
Lifecycle Hooks
• A component has a lifecycle
• Angular offers component lifecycle hooks that give us ability to capture these moments
• In other words, events
• Samples
• OnInit
• OnChanges
• OnDestory
Services
• Services are independent from any components
• To provide shared data, logic across multiple components
• Encapsulate external interactions (i.e. Rest API)
Services
Dependency Injection
• A design pattern to resolve dependencies
Retrieve Data using Http
Returns Observables instead of Promises
What is RxJS?
• RxJS is a javascript library for composing asynchronous & event-based programs by using
observable sequences
• Used within Angular
• More info
• http://reactivex.io/rxjs/
Promises vs Observable
• Promise
• Returns a single value
• Not cancellable
• Observable
• Works with multiple values over time
• Cancellable
• “Retryable”
• Supports map, filter, reduce, etc..
Routing
Summary
• Huge difference between NG1 & NG2, in terms of syntax
• NG2 is simpler in terms of Architecture
• TypeScript makes the job easier
References
•https://angular.io/docs/ts/latest/quickstart.html
•https://www.pluralsight.com/courses/angular-2-getting-started
•https://auth0.com/blog/angular-2-series-part-2-domain-models-and-dependency-injection/
•https://auth0.com/blog/angular-2-series-part-3-using-http/

Mais conteúdo relacionado

Mais procurados

Introduction to Android Programming
Introduction to Android ProgrammingIntroduction to Android Programming
Introduction to Android ProgrammingRaveendra R
 
Overview about AngularJS Framework
Overview about AngularJS Framework Overview about AngularJS Framework
Overview about AngularJS Framework Camilo Lopes
 
Angular.js - JS Camp UKraine 2013
Angular.js - JS Camp UKraine 2013Angular.js - JS Camp UKraine 2013
Angular.js - JS Camp UKraine 2013Max Klymyshyn
 
Angular js tutorial slides
Angular js tutorial slidesAngular js tutorial slides
Angular js tutorial slidessamhelman
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJSAldo Pizzagalli
 
Gettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJSGettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJSArmin Vieweg
 
AngularJS One Day Workshop
AngularJS One Day WorkshopAngularJS One Day Workshop
AngularJS One Day WorkshopShyam Seshadri
 
Introduction to single page application with angular js
Introduction to single page application with angular jsIntroduction to single page application with angular js
Introduction to single page application with angular jsMindfire Solutions
 
Angular JS - Develop Responsive Single Page Application
Angular JS - Develop Responsive Single Page ApplicationAngular JS - Develop Responsive Single Page Application
Angular JS - Develop Responsive Single Page ApplicationEdureka!
 
One Weekend With AngularJS
One Weekend With AngularJSOne Weekend With AngularJS
One Weekend With AngularJSYashobanta Bai
 
AngularJS = Browser applications on steroids
AngularJS = Browser applications on steroidsAngularJS = Browser applications on steroids
AngularJS = Browser applications on steroidsMaurice De Beijer [MVP]
 
Kalp Corporate Angular Js Tutorials
Kalp Corporate Angular Js TutorialsKalp Corporate Angular Js Tutorials
Kalp Corporate Angular Js TutorialsKalp Corporate
 

Mais procurados (19)

Introduction to Android Programming
Introduction to Android ProgrammingIntroduction to Android Programming
Introduction to Android Programming
 
Overview about AngularJS Framework
Overview about AngularJS Framework Overview about AngularJS Framework
Overview about AngularJS Framework
 
AngularJS
AngularJSAngularJS
AngularJS
 
AngularJS is awesome
AngularJS is awesomeAngularJS is awesome
AngularJS is awesome
 
Angular.js - JS Camp UKraine 2013
Angular.js - JS Camp UKraine 2013Angular.js - JS Camp UKraine 2013
Angular.js - JS Camp UKraine 2013
 
Angular js tutorial slides
Angular js tutorial slidesAngular js tutorial slides
Angular js tutorial slides
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Gettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJSGettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJS
 
Training On Angular Js
Training On Angular JsTraining On Angular Js
Training On Angular Js
 
Angular Seminar-js
Angular Seminar-jsAngular Seminar-js
Angular Seminar-js
 
Angular js PPT
Angular js PPTAngular js PPT
Angular js PPT
 
Angular js
Angular jsAngular js
Angular js
 
AngularJS One Day Workshop
AngularJS One Day WorkshopAngularJS One Day Workshop
AngularJS One Day Workshop
 
Introduction to single page application with angular js
Introduction to single page application with angular jsIntroduction to single page application with angular js
Introduction to single page application with angular js
 
Angular JS - Develop Responsive Single Page Application
Angular JS - Develop Responsive Single Page ApplicationAngular JS - Develop Responsive Single Page Application
Angular JS - Develop Responsive Single Page Application
 
One Weekend With AngularJS
One Weekend With AngularJSOne Weekend With AngularJS
One Weekend With AngularJS
 
AngularJS = Browser applications on steroids
AngularJS = Browser applications on steroidsAngularJS = Browser applications on steroids
AngularJS = Browser applications on steroids
 
Kalp Corporate Angular Js Tutorials
Kalp Corporate Angular Js TutorialsKalp Corporate Angular Js Tutorials
Kalp Corporate Angular Js Tutorials
 
Introduction to Angular JS
Introduction to Angular JSIntroduction to Angular JS
Introduction to Angular JS
 

Destaque

OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...Maarten Balliauw
 
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access ControlOAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access ControlMaarten Balliauw
 
REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)Jef Claes
 
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control
OAuth-as-a-serviceusing ASP.NET Web API and Windows Azure Access ControlOAuth-as-a-serviceusing ASP.NET Web API and Windows Azure Access Control
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access ControlMaarten Balliauw
 
OAuth with AngularJS and WebAPI - SoCal Code Camp 2015
OAuth with AngularJS and WebAPI - SoCal Code Camp 2015OAuth with AngularJS and WebAPI - SoCal Code Camp 2015
OAuth with AngularJS and WebAPI - SoCal Code Camp 2015Stuart
 
29 Essential AngularJS Interview Questions
29 Essential AngularJS Interview Questions29 Essential AngularJS Interview Questions
29 Essential AngularJS Interview QuestionsArc & Codementor
 

Destaque (9)

Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control - W...
 
Introduction to HTML4
Introduction to HTML4Introduction to HTML4
Introduction to HTML4
 
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access ControlOAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control
 
REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)
 
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control
OAuth-as-a-serviceusing ASP.NET Web API and Windows Azure Access ControlOAuth-as-a-serviceusing ASP.NET Web API and Windows Azure Access Control
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control
 
OAuth with AngularJS and WebAPI - SoCal Code Camp 2015
OAuth with AngularJS and WebAPI - SoCal Code Camp 2015OAuth with AngularJS and WebAPI - SoCal Code Camp 2015
OAuth with AngularJS and WebAPI - SoCal Code Camp 2015
 
29 Essential AngularJS Interview Questions
29 Essential AngularJS Interview Questions29 Essential AngularJS Interview Questions
29 Essential AngularJS Interview Questions
 
Javaoop
JavaoopJavaoop
Javaoop
 

Semelhante a What's new in Angular 2?

Angular Live training basic to Advance
Angular Live training basic to Advance Angular Live training basic to Advance
Angular Live training basic to Advance Dot Net Tricks
 
Best Angular Training Online: Angular tutorial | Learn Angular 2 to 10 |
Best Angular Training Online: Angular tutorial | Learn Angular 2 to 10 | Best Angular Training Online: Angular tutorial | Learn Angular 2 to 10 |
Best Angular Training Online: Angular tutorial | Learn Angular 2 to 10 | Shailendra Chauhan
 
Unlimited training using Angular p_p_t
Unlimited training  using Angular   p_p_tUnlimited training  using Angular   p_p_t
Unlimited training using Angular p_p_tNeelaSaiKiran
 
Mastering angular - Dot Net Tricks
Mastering angular - Dot Net TricksMastering angular - Dot Net Tricks
Mastering angular - Dot Net TricksGaurav Singh
 
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 conceptsSuresh Patidar
 
Angular js 2
Angular js 2Angular js 2
Angular js 2Ran Wahle
 
AngularJs (1.x) Presentation
AngularJs (1.x) PresentationAngularJs (1.x) Presentation
AngularJs (1.x) PresentationRaghubir Singh
 
Angularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetupAngularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetupGoutam Dey
 
Angular js Online Training
Angular js Online TrainingAngular js Online Training
Angular js Online TrainingLearntek1
 
Angular2 with type script
Angular2 with type scriptAngular2 with type script
Angular2 with type scriptRavi Mone
 
angular-concepts-introduction-slides.pptx
angular-concepts-introduction-slides.pptxangular-concepts-introduction-slides.pptx
angular-concepts-introduction-slides.pptxshekharmpatil1309
 

Semelhante a What's new in Angular 2? (20)

Angular
AngularAngular
Angular
 
Angular Live training basic to Advance
Angular Live training basic to Advance Angular Live training basic to Advance
Angular Live training basic to Advance
 
Best Angular Training Online: Angular tutorial | Learn Angular 2 to 10 |
Best Angular Training Online: Angular tutorial | Learn Angular 2 to 10 | Best Angular Training Online: Angular tutorial | Learn Angular 2 to 10 |
Best Angular Training Online: Angular tutorial | Learn Angular 2 to 10 |
 
Unlimited training using Angular p_p_t
Unlimited training  using Angular   p_p_tUnlimited training  using Angular   p_p_t
Unlimited training using Angular p_p_t
 
Mastering angular - Dot Net Tricks
Mastering angular - Dot Net TricksMastering angular - Dot Net Tricks
Mastering angular - Dot Net Tricks
 
Module2
Module2Module2
Module2
 
Angular js firebase-preso
Angular js firebase-presoAngular js firebase-preso
Angular js firebase-preso
 
Introduction to AngularJs
Introduction to AngularJsIntroduction to AngularJs
Introduction to AngularJs
 
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
 
Angular2
Angular2Angular2
Angular2
 
Angular js 2
Angular js 2Angular js 2
Angular js 2
 
AngularJs (1.x) Presentation
AngularJs (1.x) PresentationAngularJs (1.x) Presentation
AngularJs (1.x) Presentation
 
Angularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetupAngularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetup
 
Angular js
Angular jsAngular js
Angular js
 
Angular js
Angular jsAngular js
Angular js
 
Angular js Online Training
Angular js Online TrainingAngular js Online Training
Angular js Online Training
 
Angularjs Basics
Angularjs BasicsAngularjs Basics
Angularjs Basics
 
Asp.Net MVC 5 in Arabic
Asp.Net MVC 5 in ArabicAsp.Net MVC 5 in Arabic
Asp.Net MVC 5 in Arabic
 
Angular2 with type script
Angular2 with type scriptAngular2 with type script
Angular2 with type script
 
angular-concepts-introduction-slides.pptx
angular-concepts-introduction-slides.pptxangular-concepts-introduction-slides.pptx
angular-concepts-introduction-slides.pptx
 

Mais de Alfred Jett Grandeza

Automated testing using Selenium & NUnit
Automated testing using Selenium & NUnitAutomated testing using Selenium & NUnit
Automated testing using Selenium & NUnitAlfred Jett Grandeza
 
Software Engineering - Trends & Industry Practices
Software Engineering - Trends & Industry PracticesSoftware Engineering - Trends & Industry Practices
Software Engineering - Trends & Industry PracticesAlfred Jett Grandeza
 
Career Options for CS/IT/IS graduates
Career Options for CS/IT/IS graduatesCareer Options for CS/IT/IS graduates
Career Options for CS/IT/IS graduatesAlfred Jett Grandeza
 
Introducing MS VS LightSwitch 2011
Introducing MS VS LightSwitch 2011Introducing MS VS LightSwitch 2011
Introducing MS VS LightSwitch 2011Alfred Jett Grandeza
 

Mais de Alfred Jett Grandeza (7)

Automated testing using Selenium & NUnit
Automated testing using Selenium & NUnitAutomated testing using Selenium & NUnit
Automated testing using Selenium & NUnit
 
What’s new in VS 2017?
What’s new in VS 2017?What’s new in VS 2017?
What’s new in VS 2017?
 
Software Engineering - Trends & Industry Practices
Software Engineering - Trends & Industry PracticesSoftware Engineering - Trends & Industry Practices
Software Engineering - Trends & Industry Practices
 
Career Options for CS/IT/IS graduates
Career Options for CS/IT/IS graduatesCareer Options for CS/IT/IS graduates
Career Options for CS/IT/IS graduates
 
Software development fundamentals
Software development fundamentalsSoftware development fundamentals
Software development fundamentals
 
Introducing MS VS LightSwitch 2011
Introducing MS VS LightSwitch 2011Introducing MS VS LightSwitch 2011
Introducing MS VS LightSwitch 2011
 
Using xml in a data set (ado.net)
Using xml in a data set (ado.net)Using xml in a data set (ado.net)
Using xml in a data set (ado.net)
 

Último

Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Hiroshi SHIBATA
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...FIDO Alliance
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyUXDXConf
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPTiSEO AI
 
Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jNeo4j
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty SecureFemke de Vroome
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...CzechDreamin
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform EngineeringMarcus Vechiato
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?Mark Billinghurst
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsStefano
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101vincent683379
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfFIDO Alliance
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceSamy Fodil
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024Stephen Perrenod
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Patrick Viafore
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024Stephanie Beckett
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfSrushith Repakula
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsLeah Henrickson
 

Último (20)

Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
 
Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4j
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 

What's new in Angular 2?

  • 1. What’s new in Angular 2? A COMPARISON BETWEEN NG1.X AND NG2 Alfred Jett Grandeza Founder, Leangineer @ Lean Consulting leanconsulting.ph | ajgrandeza.com
  • 2. Lean Consulting • Davao based start-up • Founded: February 2016 • Lean Academy SOON! • More info: • leanconsulting.ph • fb.com/leanconsutling.ph
  • 3. About Me •Graduate of Ateneo de Davao, Computer Science 2012 •Over 5 years of software engineering experience, .NET and AngularJS •Former CTO of T.H.E. Patrons •Co-founder of Lean Consulting/Lean Academy •Microsoft Technology Associate (2) •Member of Davao .NET Community (Davao .NET Users Group, Philippine .NET Users Group) •I do consulting and freelance work from clients overseas •Advocate of .NET Technologies •I LOVE TO LEARN!
  • 4. Prerequisites & Tools • Required • JavaScript • HTML • CSS • Helpful • OOP concepts • Visual Studio Community • https://www.visualstudio.com/ • Visual Studio Code • https://code.visualstudio.com/
  • 5. Single Page Application • SPAs are web apps that load a single HTML page and dynamically that page as the user interacts • Much of the work happen in the client side • Usually written in JavaScript
  • 7. Angular is… • Open source, JavaScript based front-end framework • Used for building client-side applications • MVW Framework (Model-View-Whatever) • Mainly maintained by Google
  • 8. Why use Angular? • Expressive/Customizable HTML • Powerful Data Binding • Modular • Easy back-end integration
  • 9. Application Demo • NG 1.X App • NG 2 App
  • 10. Key Features of Angular 1.X • Directives • Data binding • Views • Controllers • $scope • Modules • Dependency Injection • Routes • Services
  • 11. What is a directive? • Extends HTML attributes, with the prefix “ng-” • Teaches HTML new tricks • There are built-in directives • ng-app • ng-view • You can also create your own custom directives
  • 12. Data Binding • Interpolation • {{name}} • Event Binding • ng-click=“onClick()” • Two-way Binding • <input ng-model=“name” />
  • 13. Filters & Pipes • Filters can be added to filter an array •Pipes can be used to format a data
  • 14. Views, Controllers, Scope •View – UI / Display •Controllers – Controls the logic, data and flow •$scope is the “glue” between controller and view or the ViewModel
  • 15. Modules & DI • A container for the different parts of your Angular app • You can package code as reusable modules • You may inject different modules to your module • Dependency Injection • Instantiate a module • ng-app=“” • Creating a module • angular.module(‘demoApp’, [])
  • 16. Routes • is used for deep-linking URLs to controllers and views
  • 17. Services • Are for organizing and share code across your application
  • 18. Summary for NG1 Key Features • Directives • Data binding • Views • Controllers • $scope • Modules • Dependency Injection • Routes • Services
  • 19. Angular 2.0 with TypeScript Live release: Sept 16, 2016 http://angularjs.blogspot.com/2016/09/angular2-final.html
  • 20. Why Angular 2? • Built for speed • Modern • Simplified API • Enhanced Productivity • Develop Across All Platforms
  • 21. What is TypeScript? • Open source programming language • Developed and maintained by Microsoft • A superset of JavaScript • Transpiles to plain JavaScript • Strongly typed • Class based / OOP approach • Learn more: • http://www.typescriptlang.org/Playground
  • 22. Setting up • Download • https://github.com/angular/quickstart
  • 23. Angular 2 Key Features • Components • Templates • Directives • Data Binding & Pipes • Life-cycle hooks • Services • Dependency Injection • Routes
  • 24. Anatomy of NG 2 Image grabbed from: https://www.pluralsight.com/courses/angular-2-getting-started
  • 25. Anatomy of a Component Image grabbed from: https://www.pluralsight.com/courses/angular-2-getting-started
  • 26. Components Image grabbed from: https://www.pluralsight.com/courses/angular-2-getting-started
  • 28. Decorator • A function that adds metadata to a class • Prefixed with an @ • @Component()
  • 29. Defining a Template in a Component • Inline template •Linked Template
  • 30. Data Binding • Coordinates communication between the component’s class and template • Interpolation • {{name}} • Event Binding • (click)=‘onClick()’ • Two-way Binding • <input [(ngModel)]=‘name’ /> • Property Binding • <img [src] = ‘customer.thumbnail’ />
  • 31. Directive in NG2 • Built-in directives • *ngIf • *ngFor
  • 32. Pipes • | lowercase • | currency • | uppercase • No more filter  • You have to create your own pipe
  • 33. Lifecycle Hooks • A component has a lifecycle • Angular offers component lifecycle hooks that give us ability to capture these moments • In other words, events • Samples • OnInit • OnChanges • OnDestory
  • 34. Services • Services are independent from any components • To provide shared data, logic across multiple components • Encapsulate external interactions (i.e. Rest API)
  • 36. Dependency Injection • A design pattern to resolve dependencies
  • 37. Retrieve Data using Http Returns Observables instead of Promises
  • 38. What is RxJS? • RxJS is a javascript library for composing asynchronous & event-based programs by using observable sequences • Used within Angular • More info • http://reactivex.io/rxjs/
  • 39. Promises vs Observable • Promise • Returns a single value • Not cancellable • Observable • Works with multiple values over time • Cancellable • “Retryable” • Supports map, filter, reduce, etc..
  • 41. Summary • Huge difference between NG1 & NG2, in terms of syntax • NG2 is simpler in terms of Architecture • TypeScript makes the job easier