SlideShare a Scribd company logo
ANGULAR 2.0
RELEASED ON 14TH SEPTEMBER, 2016 - GOOGLE
ANGULAR 2.0
• Development platform for building mobile and desktop web applications.
• Angular 2 is not an upgrade of 1. Its totally rewrite.
• Default language –Typescript
WHY ANGULAR 2.0?
• Component based.Modularization, reusability, maintainable, reliable.
• Mobile oriented. Learn once, write anywhere.
• Provides more choice for languages.ES5, ES6,Typescript or Dart.
• Powerful routes.Child/Nested routing.
• Dependency injection. Child injectors.
• Forms
BUILDING BLOCKS OF APPLICATION
1. Modules
2. Components
3. Templates
4. Metadata
5. Data Binding
6. Directives
7. Services
8. Dependency Injection
MODULE
• Angular app should have one root module.
• Conventionally named as appModule.
• Module class consists of NgModule decorator, function that takes a single metadata
object whose properties describe the module.
• Allows to register directives,components,service and many other things in a single place.
Ngmodule
• declaration
• exports
• imports
• providers
• bootstrap
NgModule
declarations
- List components,directives,pipes.
- Can declare in another module but just declare it once.
- Module classes,service classes,non-angular classes and objects are not required to
declare.
exports
- To make visible to another module.
- Export components,directives,pipes.
- If not export then visible only to other component declared in this module.
NgModule
imports
- List supporting modules for a component declared in this module.
providers
- List of dependency injection providers
bootstrap
- Only root module should set bootstrap property.
COMPONENTS
• Helps to render the view page.
• Controls the appearance and behavior of a view through its template.
• Component decorator, a function that takes a configuration object.
@Component({
selector:'hello-world',
template: `<div>Hello world</div>`
})
Template : <div><hello-world></hello-world></div>
Component
• selector
Name of the HTML tag.
• template
Placeholder for the HTML.
• templateUrl
Source for component template, separate HTML file.
Take relative path.
• Other metadata : directives, providers,styleUrls …
TEMPLATES
• A form HTML page.
• But have additional angular template syntax.
<p>The sum of 2 + 4 is {{2 + 4}}</p> Template expression
<h3> {{title}}</h3> Component property
<p>The sum of 2 + 4 is not {{2 + 4 + getValue()}}</p> Component Method
TEMPLATES
• One way data binding
• {{ }} => Interpolation.Display a component property,
• [ ] => Property binding. Bind the value to the property.
• ( ) => Event binding.
• [()] =>Two way data binding
METADATA
• Define how to process a class.
• Metadata answers the following questions.
• what is it?
• what does it need?
DATA BINDING
• Communication between a template and its component.Or between parent and child
components.
DATA BINDING
• BindingType (Divided based on the direction in which data flows)
1. Interpolation | property | attribute
One way from source to target.Data source =>View target.
{{expression}} => <h2>{{title}}</h2>
[target] = "expression" => <span [hidden] = “isSet” ></span>
2. Event
One way from target to source.View target => Data source.
(target) = "statement” => (click) = ‘callMe’
3. Two way
[(target)] = "expression” => [(ngModel)] = ‘callMe’
DIRECTIVES
• Transforms the DOM.
• Can create custom directive.
• Types :
1. Components
Directive with a template(mandatory).
2. Attribute Directive
Add appearance or behavior to an existing element.ngModel, ngSwitch
3. Structural Directive
Change the DOM layouts by adding/removing/replacing elements
Eg : ngFor, ngIf
SERVICES
• Services hold business logic for a component.
• Services are available to components through dependency injection.
DEPENDENCY INJECTION
• A way to supply a new instance of a class with the fully-formed dependencies it requires.
• Uses to provide the component with the services they need.
• Supports nested injectors in parallel with the component tree.
• No need to configure providers at each level.
DEPENDENCY INJECTION
Child injectors
ServiceA
ComponentA Component B
Root Component
DEPENDENCY INJECTION
@Component({
providers:[ProductService]
})
class ProductComponent {
product:Product;
constructor(private productService: ProductService) {
this.product = this.productService.getProduct();
}
}
OTHER FEATURES AND SERVICES
• Pipes
- Formatting and transformation the data in template.
- Built in pipes :currency,date, uppercase, Json,lowercase, decimal,percent.
- Custom pipe can be created.
Eg:
price | currency:'USD':true =====> 42.33 as $42.33
book.title | lowercase =====> AngularJs => angularjs
ROUTING
• It enables navigation from one view to the next as users perform application tasks.
• Three main components of Routing
• Route Object => Describes our application’s routes.
• RouterOutlet =>A placeholder component that gets expanded to each route’s content.
• RouterLink => Directive for binding a clickable HTML element to a route.
ROUTING
Routes = [
{path:'',redirectTo:'/home',pathMatch:'full'},
{path:'home',component:HomeComponent},
{path:contact/:id',component:ContactComponent}
ROUTING
<html><header></header><body>
<div id="menu”>
<a [routerLink]="['/home']" class="btn">Home</a>
<a [routerLink]="['/about']" class="btn">About</a>
</div>
<div id="container">
<router-outlet></router-outlet>
</div>
</body></html>
TYPESCRIPT
• Open source
• Developed by Microsoft
• Superset of JavaScript
• Has own compiler to convert javascript.
• Includes many aspects of object orientation.
• Inheritance,Interfaces,Generics, Lambdas
FUTURE PLANS
• Bug fixes and non-breaking features for APIs marked as stable
• More guides and live examples specific to your use cases
• More work on animations
• Angular Material 2
• MovingWebWorkers out of experimental
• More features and more languages for Angular Universal
• Even more speed and payload size improvements
NOTE
• Angular CLI provide a command line interface from initial project generation to
production deployment.
• https://cli.angular.io/)
• https://github.com/angular/angular-cli
REFERENCES
• https://github.com/angular
• https://www.typescriptlang.org/
THANK YOU

More Related Content

What's hot

JDBC
JDBCJDBC
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivity
Tanmoy Barman
 
Java database connectivity
Java database connectivityJava database connectivity
Java database connectivity
Vaishali Modi
 
Database and Java Database Connectivity
Database and Java Database ConnectivityDatabase and Java Database Connectivity
Database and Java Database Connectivity
Gary Yeh
 
Jdbc
JdbcJdbc
JSP Scope variable And Data Sharing
JSP Scope variable And Data SharingJSP Scope variable And Data Sharing
JSP Scope variable And Data Sharingvikram singh
 
Core jdbc basics
Core jdbc basicsCore jdbc basics
Core jdbc basics
Sourabrata Mukherjee
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 6...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 6... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 6...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 6...
WebStackAcademy
 
Hibernate ppt
Hibernate pptHibernate ppt
Hibernate ppt
Aneega
 
Jdbc complete
Jdbc completeJdbc complete
Jdbc complete
Sandeep Rawat
 
Spring (1)
Spring (1)Spring (1)
Spring (1)
Aneega
 
Jeff Huber Portfoilio
Jeff Huber PortfoilioJeff Huber Portfoilio
Jeff Huber Portfoilio
JeffHuber
 
JSP Processing
JSP ProcessingJSP Processing
JSP ProcessingSadhana28
 
Hibernate presentation
Hibernate presentationHibernate presentation
Hibernate presentation
Manav Prasad
 
Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)
Pooja Talreja
 
Jsp tag library
Jsp tag libraryJsp tag library
Jsp tag library
sandeep54552
 
Database Access With JDBC
Database Access With JDBCDatabase Access With JDBC
Database Access With JDBC
Dharani Kumar Madduri
 

What's hot (19)

JDBC
JDBCJDBC
JDBC
 
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivity
 
Java database connectivity
Java database connectivityJava database connectivity
Java database connectivity
 
Database and Java Database Connectivity
Database and Java Database ConnectivityDatabase and Java Database Connectivity
Database and Java Database Connectivity
 
Jdbc
JdbcJdbc
Jdbc
 
JSP Scope variable And Data Sharing
JSP Scope variable And Data SharingJSP Scope variable And Data Sharing
JSP Scope variable And Data Sharing
 
Core jdbc basics
Core jdbc basicsCore jdbc basics
Core jdbc basics
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 6...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 6... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 6...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 6...
 
Hibernate ppt
Hibernate pptHibernate ppt
Hibernate ppt
 
Jdbc complete
Jdbc completeJdbc complete
Jdbc complete
 
Spring (1)
Spring (1)Spring (1)
Spring (1)
 
Jeff Huber Portfoilio
Jeff Huber PortfoilioJeff Huber Portfoilio
Jeff Huber Portfoilio
 
JDBC
JDBCJDBC
JDBC
 
JSP Processing
JSP ProcessingJSP Processing
JSP Processing
 
Hibernate presentation
Hibernate presentationHibernate presentation
Hibernate presentation
 
Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)
 
Jsp tag library
Jsp tag libraryJsp tag library
Jsp tag library
 
Jsp
JspJsp
Jsp
 
Database Access With JDBC
Database Access With JDBCDatabase Access With JDBC
Database Access With JDBC
 

Similar to Angular2

Angular
AngularAngular
What's new in Angular 2?
What's new in Angular 2?What's new in Angular 2?
What's new in Angular 2?
Alfred Jett Grandeza
 
Angular 2 with typescript
Angular 2 with typescriptAngular 2 with typescript
Angular 2 with typescript
Tayseer_Emam
 
Angular js 2
Angular js 2Angular js 2
Angular js 2
Ran Wahle
 
17612235.ppt
17612235.ppt17612235.ppt
17612235.ppt
yovixi5669
 
Unit-III(Design).pptx
Unit-III(Design).pptxUnit-III(Design).pptx
Unit-III(Design).pptx
Fajar Baskoro
 
Angular 9
Angular 9 Angular 9
Angular 9
Raja Vishnu
 
Angular js firebase-preso
Angular js firebase-presoAngular js firebase-preso
Angular js firebase-preso
Avinash Kondagunta
 
70487.pdf
70487.pdf70487.pdf
70487.pdf
Karen Benoit
 
Moving From AngularJS to Angular 2
Moving From AngularJS to  Angular 2 Moving From AngularJS to  Angular 2
Moving From AngularJS to Angular 2
Exilesoft
 
Angular2 with type script
Angular2 with type scriptAngular2 with type script
Angular2 with type script
Ravi Mone
 
Building Blocks of Angular 2 and ASP.NET Core
Building Blocks of Angular 2 and ASP.NET CoreBuilding Blocks of Angular 2 and ASP.NET Core
Building Blocks of Angular 2 and ASP.NET Core
Levi Fuller
 
Unit 2 - Data Binding.pptx
Unit 2 - Data Binding.pptxUnit 2 - Data Binding.pptx
Unit 2 - Data Binding.pptx
Malla Reddy University
 
MuleSoft Surat Virtual Meetup#28 - Exposing and Consuming SOAP Service - SOAP...
MuleSoft Surat Virtual Meetup#28 - Exposing and Consuming SOAP Service - SOAP...MuleSoft Surat Virtual Meetup#28 - Exposing and Consuming SOAP Service - SOAP...
MuleSoft Surat Virtual Meetup#28 - Exposing and Consuming SOAP Service - SOAP...
Jitendra Bafna
 
Angular2 with TypeScript
Angular2 with TypeScript Angular2 with TypeScript
Angular2 with TypeScript
Rohit Bishnoi
 
Angular 2 overview in 60 minutes
Angular 2 overview in 60 minutesAngular 2 overview in 60 minutes
Angular 2 overview in 60 minutes
Loiane Groner
 
Angular Basics.pptx
Angular Basics.pptxAngular Basics.pptx
Angular Basics.pptx
AshokKumar616995
 
AngularJS
AngularJSAngularJS
AngularJS
Yogesh L
 
Angular crash course
Angular crash courseAngular crash course
Angular crash course
Birhan Nega
 

Similar to Angular2 (20)

Angular
AngularAngular
Angular
 
What's new in Angular 2?
What's new in Angular 2?What's new in Angular 2?
What's new in Angular 2?
 
Angular 2 with typescript
Angular 2 with typescriptAngular 2 with typescript
Angular 2 with typescript
 
Angular js 2
Angular js 2Angular js 2
Angular js 2
 
17612235.ppt
17612235.ppt17612235.ppt
17612235.ppt
 
Unit-III(Design).pptx
Unit-III(Design).pptxUnit-III(Design).pptx
Unit-III(Design).pptx
 
Angular 9
Angular 9 Angular 9
Angular 9
 
Angular js firebase-preso
Angular js firebase-presoAngular js firebase-preso
Angular js firebase-preso
 
70487.pdf
70487.pdf70487.pdf
70487.pdf
 
Moving From AngularJS to Angular 2
Moving From AngularJS to  Angular 2 Moving From AngularJS to  Angular 2
Moving From AngularJS to Angular 2
 
Angular2 with type script
Angular2 with type scriptAngular2 with type script
Angular2 with type script
 
Building Blocks of Angular 2 and ASP.NET Core
Building Blocks of Angular 2 and ASP.NET CoreBuilding Blocks of Angular 2 and ASP.NET Core
Building Blocks of Angular 2 and ASP.NET Core
 
Unit 2 - Data Binding.pptx
Unit 2 - Data Binding.pptxUnit 2 - Data Binding.pptx
Unit 2 - Data Binding.pptx
 
MuleSoft Surat Virtual Meetup#28 - Exposing and Consuming SOAP Service - SOAP...
MuleSoft Surat Virtual Meetup#28 - Exposing and Consuming SOAP Service - SOAP...MuleSoft Surat Virtual Meetup#28 - Exposing and Consuming SOAP Service - SOAP...
MuleSoft Surat Virtual Meetup#28 - Exposing and Consuming SOAP Service - SOAP...
 
Angular2 with TypeScript
Angular2 with TypeScript Angular2 with TypeScript
Angular2 with TypeScript
 
Angular 2 overview in 60 minutes
Angular 2 overview in 60 minutesAngular 2 overview in 60 minutes
Angular 2 overview in 60 minutes
 
Angular Basics.pptx
Angular Basics.pptxAngular Basics.pptx
Angular Basics.pptx
 
AngularJS
AngularJSAngularJS
AngularJS
 
Resume
ResumeResume
Resume
 
Angular crash course
Angular crash courseAngular crash course
Angular crash course
 

Recently uploaded

Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.pptPROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
bhadouriyakaku
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
ClaraZara1
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
ssuser7dcef0
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
awadeshbabu
 
AIR POLLUTION lecture EnE203 updated.pdf
AIR POLLUTION lecture EnE203 updated.pdfAIR POLLUTION lecture EnE203 updated.pdf
AIR POLLUTION lecture EnE203 updated.pdf
RicletoEspinosa1
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
NidhalKahouli2
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
SyedAbiiAzazi1
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
anoopmanoharan2
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
camseq
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
symbo111
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 
Self-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptxSelf-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptx
iemerc2024
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 

Recently uploaded (20)

Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.pptPROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
 
AIR POLLUTION lecture EnE203 updated.pdf
AIR POLLUTION lecture EnE203 updated.pdfAIR POLLUTION lecture EnE203 updated.pdf
AIR POLLUTION lecture EnE203 updated.pdf
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 
Self-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptxSelf-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptx
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 

Angular2

  • 1. ANGULAR 2.0 RELEASED ON 14TH SEPTEMBER, 2016 - GOOGLE
  • 2. ANGULAR 2.0 • Development platform for building mobile and desktop web applications. • Angular 2 is not an upgrade of 1. Its totally rewrite. • Default language –Typescript
  • 3. WHY ANGULAR 2.0? • Component based.Modularization, reusability, maintainable, reliable. • Mobile oriented. Learn once, write anywhere. • Provides more choice for languages.ES5, ES6,Typescript or Dart. • Powerful routes.Child/Nested routing. • Dependency injection. Child injectors. • Forms
  • 4. BUILDING BLOCKS OF APPLICATION 1. Modules 2. Components 3. Templates 4. Metadata 5. Data Binding 6. Directives 7. Services 8. Dependency Injection
  • 5. MODULE • Angular app should have one root module. • Conventionally named as appModule. • Module class consists of NgModule decorator, function that takes a single metadata object whose properties describe the module. • Allows to register directives,components,service and many other things in a single place.
  • 6. Ngmodule • declaration • exports • imports • providers • bootstrap
  • 7. NgModule declarations - List components,directives,pipes. - Can declare in another module but just declare it once. - Module classes,service classes,non-angular classes and objects are not required to declare. exports - To make visible to another module. - Export components,directives,pipes. - If not export then visible only to other component declared in this module.
  • 8. NgModule imports - List supporting modules for a component declared in this module. providers - List of dependency injection providers bootstrap - Only root module should set bootstrap property.
  • 9. COMPONENTS • Helps to render the view page. • Controls the appearance and behavior of a view through its template. • Component decorator, a function that takes a configuration object. @Component({ selector:'hello-world', template: `<div>Hello world</div>` }) Template : <div><hello-world></hello-world></div>
  • 10. Component • selector Name of the HTML tag. • template Placeholder for the HTML. • templateUrl Source for component template, separate HTML file. Take relative path. • Other metadata : directives, providers,styleUrls …
  • 11. TEMPLATES • A form HTML page. • But have additional angular template syntax. <p>The sum of 2 + 4 is {{2 + 4}}</p> Template expression <h3> {{title}}</h3> Component property <p>The sum of 2 + 4 is not {{2 + 4 + getValue()}}</p> Component Method
  • 12. TEMPLATES • One way data binding • {{ }} => Interpolation.Display a component property, • [ ] => Property binding. Bind the value to the property. • ( ) => Event binding. • [()] =>Two way data binding
  • 13. METADATA • Define how to process a class. • Metadata answers the following questions. • what is it? • what does it need?
  • 14. DATA BINDING • Communication between a template and its component.Or between parent and child components.
  • 15. DATA BINDING • BindingType (Divided based on the direction in which data flows) 1. Interpolation | property | attribute One way from source to target.Data source =>View target. {{expression}} => <h2>{{title}}</h2> [target] = "expression" => <span [hidden] = “isSet” ></span> 2. Event One way from target to source.View target => Data source. (target) = "statement” => (click) = ‘callMe’ 3. Two way [(target)] = "expression” => [(ngModel)] = ‘callMe’
  • 16. DIRECTIVES • Transforms the DOM. • Can create custom directive. • Types : 1. Components Directive with a template(mandatory). 2. Attribute Directive Add appearance or behavior to an existing element.ngModel, ngSwitch 3. Structural Directive Change the DOM layouts by adding/removing/replacing elements Eg : ngFor, ngIf
  • 17. SERVICES • Services hold business logic for a component. • Services are available to components through dependency injection.
  • 18. DEPENDENCY INJECTION • A way to supply a new instance of a class with the fully-formed dependencies it requires. • Uses to provide the component with the services they need. • Supports nested injectors in parallel with the component tree. • No need to configure providers at each level.
  • 20. DEPENDENCY INJECTION @Component({ providers:[ProductService] }) class ProductComponent { product:Product; constructor(private productService: ProductService) { this.product = this.productService.getProduct(); } }
  • 21. OTHER FEATURES AND SERVICES • Pipes - Formatting and transformation the data in template. - Built in pipes :currency,date, uppercase, Json,lowercase, decimal,percent. - Custom pipe can be created. Eg: price | currency:'USD':true =====> 42.33 as $42.33 book.title | lowercase =====> AngularJs => angularjs
  • 22. ROUTING • It enables navigation from one view to the next as users perform application tasks. • Three main components of Routing • Route Object => Describes our application’s routes. • RouterOutlet =>A placeholder component that gets expanded to each route’s content. • RouterLink => Directive for binding a clickable HTML element to a route.
  • 24. ROUTING <html><header></header><body> <div id="menu”> <a [routerLink]="['/home']" class="btn">Home</a> <a [routerLink]="['/about']" class="btn">About</a> </div> <div id="container"> <router-outlet></router-outlet> </div> </body></html>
  • 25. TYPESCRIPT • Open source • Developed by Microsoft • Superset of JavaScript • Has own compiler to convert javascript. • Includes many aspects of object orientation. • Inheritance,Interfaces,Generics, Lambdas
  • 26. FUTURE PLANS • Bug fixes and non-breaking features for APIs marked as stable • More guides and live examples specific to your use cases • More work on animations • Angular Material 2 • MovingWebWorkers out of experimental • More features and more languages for Angular Universal • Even more speed and payload size improvements
  • 27. NOTE • Angular CLI provide a command line interface from initial project generation to production deployment. • https://cli.angular.io/) • https://github.com/angular/angular-cli