SlideShare a Scribd company logo
https://www.youtube.com/watch?v=hxuDIvMtGsw&feature=youtu.be&t=412
Domenico Rutigliano WEB SOLUTION ENGINEER
Benefit coming with AngularJS 2
This on the left is a React Coder Face
Expression while reading about
AngularJS 2.0
1. Faster and Modern Browser
2. Mobile Driven
3. More Flexible
4. Better Performance
5. Easier Implementation
6. Simplified Dependency Injection
7. Stronger Routing
8. Command Line Interface !!!!!!
Angular 2 is entirely component based. Controllers and $scope are no longer used. They have
been replaced by components and directives. Components are directives with a template.
AngularJS 2 CLI
AngularJS 2 uses TypeScript
TypeScript is a typed superset of JavaScript that compiles to plain JavaScript.
1. Starts and ends with JavaScripts
2. Strong tools for large Apps
3. State of the art JavaScript
TypeScript offers support for the latest and evolving JavaScript
features, including those from ECMAScript 2015 and future
proposals, like async functions and decorators, to help build
robust components.
TypeScript Magic : ECMAScript GAP Sorted out.
We can write TS which uses latest features of ES then downgrade to most diffuse
version on production that is actually supported by any OS/Browser/Device so we
can get the advantages of latest features which simplify coders life and then
downgrade to any version of ES we need.
AngularJS 2 First App
$ ng new ng-Squiz
I can see in my terminal the magic happening.
For the sake of demonstrate the potential of
AngularJS 2 I am going to create a simple app
which Create a Task List.
AngularJS 2 Task List App
$ ng serve
We will quickly get our app running in the
browser.
Now to meet the requirement of my Task List
App I need:
1. A TaskList class to represent individual
Task
2. A TaskList service to create update and
remove Tasks
3. A TaskApp Component to display the
user interface
AngularJS 2 Task List App
$ ng generate class TaskList
I installed into my IDE (Netbeans) the Type
Script Editor Plugin. I then created a project
based on the already existing source code
generated by Angular CLI.
I opened the task-list.ts and started inserting
the properties I want to define for each Task:
id: number, unique ID of the todo item
title: string, title of the todo item
complete: boolean, whether or not the task is
complete
AngularJS 2 Task List App
Unit Test
Angular CLI by default generates a
src/app/task-list.spec.ts for us! Let’s add a unit
test to make sure the constructor logic works
as expected
$ ng test
To verify whether our code works as expected,
I executed ng test which is going to run the unit
Test
AngularJS 2 Task List App
$ ng generate service TaskList
We can now add our task management logic to
our TaskListService in src/app/task-
list.service.ts
The actual implementation details of the
methods are not essential for the purpose of
this presentation. The main takeaway is that
we centralize the business logic in a
service.
I collapsed some nodes to fit everything in
a screenshot.
A repository of the original source code is
available on this link
AngularJS 2 Task List App
$ ng test
To make sure our logic works as expected, let’s
add unit tests to src/app/todo.service.spec.ts
which was already generated by Angular CLI.
Because Angular CLI already generates the
boilerplate code for us, we only have to worry
about implementing the tests.
AngularJS 2 Task List App
$ ng generate component TaskListApp
Template and styles can also be specified
inline inside the script file. Angular CLI creates
separate files by default. I do not really love to
include Markup code into the script file so I will
keep the same configuration.
AngularJS 2 Task List App
Telling Angular to run our new component
In index.html you also need to change
<app-root>Awesomness is coming...</app-root>
To <task-list-app>Awesomness is coming...</task-list-app>
And main.ts needs to be changed to:
import { bootstrap } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import {environment} from './app/';
import { TaskListComponent } from './app/task-list-app';
if (environment.production) {
enableProdMode();
}
bootstrap(TodoAppComponent);
THANKS FOR ATTENDING THIS SFM
https://gitlab.squiz.net/drutigliano/AngularJS2APP

More Related Content

PPTX
Async patterns in javascript
PPTX
Angular js 2
PDF
Angular 2: core concepts
PDF
The evolution of Angular 2 @ AngularJS Munich Meetup #5
PDF
Introduction to Angular 2
PDF
Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016
PDF
Angular2 with TypeScript
PDF
Angular 2 - The Next Framework
Async patterns in javascript
Angular js 2
Angular 2: core concepts
The evolution of Angular 2 @ AngularJS Munich Meetup #5
Introduction to Angular 2
Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016
Angular2 with TypeScript
Angular 2 - The Next Framework

What's hot (20)

ODP
Introduction to Angular 2
PDF
Tech Webinar: Angular 2, Introduction to a new framework
PDF
The productive developer guide to Angular 2
PDF
Angular2 - In Action
PPTX
Introduction to angular 2
PPTX
Angular 4 Introduction Tutorial
PDF
Angular 2 Essential Training
PPTX
Angular 2
PDF
Data Flow Patterns in Angular 2 - Sebastian Müller
PPTX
PDF
Angular Dependency Injection
PDF
Angular 2 - An Introduction
PPTX
What’s new in angular 2
PPTX
Migrating an application from Angular 1 to Angular 2
PDF
Angular2 with type script
PDF
Building Universal Applications with Angular 2
PDF
Angular 2: What's New?
PDF
Commit University - Exploring Angular 2
PPTX
Angular1x and Angular 2 for Beginners
PPTX
Angular 2.0: Getting ready
Introduction to Angular 2
Tech Webinar: Angular 2, Introduction to a new framework
The productive developer guide to Angular 2
Angular2 - In Action
Introduction to angular 2
Angular 4 Introduction Tutorial
Angular 2 Essential Training
Angular 2
Data Flow Patterns in Angular 2 - Sebastian Müller
Angular Dependency Injection
Angular 2 - An Introduction
What’s new in angular 2
Migrating an application from Angular 1 to Angular 2
Angular2 with type script
Building Universal Applications with Angular 2
Angular 2: What's New?
Commit University - Exploring Angular 2
Angular1x and Angular 2 for Beginners
Angular 2.0: Getting ready
Ad

Viewers also liked (11)

PDF
Cassandra Day Atlanta 2015: Feeding Solr at Large Scale with Apache Cassandra
PDF
Angular js
ODP
Intro to cassandra
PDF
Angular Weekend
PDF
Monitoring Cassandra at Scale (Jason Cacciatore, Netflix) | C* Summit 2016
PDF
Angular 2 for Java Developers
PDF
AngularJS 101 - Everything you need to know to get started
PDF
AngularJS Basics with Example
PPTX
AngularJS2
PDF
Getting Started with Angular 2
PDF
Data processing platforms architectures with Spark, Mesos, Akka, Cassandra an...
Cassandra Day Atlanta 2015: Feeding Solr at Large Scale with Apache Cassandra
Angular js
Intro to cassandra
Angular Weekend
Monitoring Cassandra at Scale (Jason Cacciatore, Netflix) | C* Summit 2016
Angular 2 for Java Developers
AngularJS 101 - Everything you need to know to get started
AngularJS Basics with Example
AngularJS2
Getting Started with Angular 2
Data processing platforms architectures with Spark, Mesos, Akka, Cassandra an...
Ad

Similar to AngularJS2 / TypeScript / CLI (20)

PPTX
PDF
Angular 2... so can I use it now??
PDF
Angular 2 - How we got here?
PPTX
Angular 2 On Production (IT Talk in Dnipro)
PPTX
AngularConf2016 - A leap of faith !?
PPTX
PPTX
An afternoon with angular 2
PDF
Angular 2 overview
PPTX
Angular2 for Beginners
PDF
Quick introduction to Angular 4 for AngularJS 1.5 developers
PPTX
Moving From AngularJS to Angular 2
PPTX
Angular 2.0
PPTX
Angular 2 with typescript
PDF
Angular, the New Angular JS
PPTX
Angular TS(typescript)
PDF
5 Key Benefits of Migration
PPTX
Angular2 getting started by Stephen Lautier
PPTX
An evening with Angular 2
PPT
Angular.ppt
PDF
Angular js
Angular 2... so can I use it now??
Angular 2 - How we got here?
Angular 2 On Production (IT Talk in Dnipro)
AngularConf2016 - A leap of faith !?
An afternoon with angular 2
Angular 2 overview
Angular2 for Beginners
Quick introduction to Angular 4 for AngularJS 1.5 developers
Moving From AngularJS to Angular 2
Angular 2.0
Angular 2 with typescript
Angular, the New Angular JS
Angular TS(typescript)
5 Key Benefits of Migration
Angular2 getting started by Stephen Lautier
An evening with Angular 2
Angular.ppt
Angular js

Recently uploaded (20)

PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
medical staffing services at VALiNTRY
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
Odoo POS Development Services by CandidRoot Solutions
PPT
Introduction Database Management System for Course Database
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Online Work Permit System for Fast Permit Processing
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Digital Strategies for Manufacturing Companies
PDF
Nekopoi APK 2025 free lastest update
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
history of c programming in notes for students .pptx
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Upgrade and Innovation Strategies for SAP ERP Customers
Navsoft: AI-Powered Business Solutions & Custom Software Development
2025 Textile ERP Trends: SAP, Odoo & Oracle
medical staffing services at VALiNTRY
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Odoo POS Development Services by CandidRoot Solutions
Introduction Database Management System for Course Database
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Online Work Permit System for Fast Permit Processing
Understanding Forklifts - TECH EHS Solution
Digital Strategies for Manufacturing Companies
Nekopoi APK 2025 free lastest update
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
history of c programming in notes for students .pptx
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
How to Choose the Right IT Partner for Your Business in Malaysia

AngularJS2 / TypeScript / CLI

  • 2. Benefit coming with AngularJS 2 This on the left is a React Coder Face Expression while reading about AngularJS 2.0 1. Faster and Modern Browser 2. Mobile Driven 3. More Flexible 4. Better Performance 5. Easier Implementation 6. Simplified Dependency Injection 7. Stronger Routing 8. Command Line Interface !!!!!! Angular 2 is entirely component based. Controllers and $scope are no longer used. They have been replaced by components and directives. Components are directives with a template.
  • 4. AngularJS 2 uses TypeScript TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. 1. Starts and ends with JavaScripts 2. Strong tools for large Apps 3. State of the art JavaScript TypeScript offers support for the latest and evolving JavaScript features, including those from ECMAScript 2015 and future proposals, like async functions and decorators, to help build robust components.
  • 5. TypeScript Magic : ECMAScript GAP Sorted out. We can write TS which uses latest features of ES then downgrade to most diffuse version on production that is actually supported by any OS/Browser/Device so we can get the advantages of latest features which simplify coders life and then downgrade to any version of ES we need.
  • 6. AngularJS 2 First App $ ng new ng-Squiz I can see in my terminal the magic happening. For the sake of demonstrate the potential of AngularJS 2 I am going to create a simple app which Create a Task List.
  • 7. AngularJS 2 Task List App $ ng serve We will quickly get our app running in the browser. Now to meet the requirement of my Task List App I need: 1. A TaskList class to represent individual Task 2. A TaskList service to create update and remove Tasks 3. A TaskApp Component to display the user interface
  • 8. AngularJS 2 Task List App $ ng generate class TaskList I installed into my IDE (Netbeans) the Type Script Editor Plugin. I then created a project based on the already existing source code generated by Angular CLI. I opened the task-list.ts and started inserting the properties I want to define for each Task: id: number, unique ID of the todo item title: string, title of the todo item complete: boolean, whether or not the task is complete
  • 9. AngularJS 2 Task List App Unit Test Angular CLI by default generates a src/app/task-list.spec.ts for us! Let’s add a unit test to make sure the constructor logic works as expected $ ng test To verify whether our code works as expected, I executed ng test which is going to run the unit Test
  • 10. AngularJS 2 Task List App $ ng generate service TaskList We can now add our task management logic to our TaskListService in src/app/task- list.service.ts The actual implementation details of the methods are not essential for the purpose of this presentation. The main takeaway is that we centralize the business logic in a service. I collapsed some nodes to fit everything in a screenshot. A repository of the original source code is available on this link
  • 11. AngularJS 2 Task List App $ ng test To make sure our logic works as expected, let’s add unit tests to src/app/todo.service.spec.ts which was already generated by Angular CLI. Because Angular CLI already generates the boilerplate code for us, we only have to worry about implementing the tests.
  • 12. AngularJS 2 Task List App $ ng generate component TaskListApp Template and styles can also be specified inline inside the script file. Angular CLI creates separate files by default. I do not really love to include Markup code into the script file so I will keep the same configuration.
  • 13. AngularJS 2 Task List App Telling Angular to run our new component In index.html you also need to change <app-root>Awesomness is coming...</app-root> To <task-list-app>Awesomness is coming...</task-list-app> And main.ts needs to be changed to: import { bootstrap } from '@angular/platform-browser-dynamic'; import { enableProdMode } from '@angular/core'; import {environment} from './app/'; import { TaskListComponent } from './app/task-list-app'; if (environment.production) { enableProdMode(); } bootstrap(TodoAppComponent);
  • 14. THANKS FOR ATTENDING THIS SFM https://gitlab.squiz.net/drutigliano/AngularJS2APP