SlideShare a Scribd company logo
AN INTRODUCTION TO
ANGULAR 2
Ivan Matiishyn
Senior front-end developer @DataArt
2016
Agenda
1. What is Angular2
2. TypeScript
3. Angular2 ecosystem
4. Component Architecture
What is Angular2?
What is Angular2?
• JavaScript framework for SPA (link)
• DI, Change Detection
• Everything you need for complex app
• Current state - RC5
• Server-side Rendering (link)
• Lazy Loading
• Native App Support (link)
• Web Workers
4
TypeScript
5
TypeScript
ES2016
ES2015
ES5
6
TypeScript
Types:
• string
• number
• boolean
• Array
• any
• Custom types
7
Tools:
• VS Code
• Playground (link)
Angular2 ecosystem
8
Angular2 ecosystem
• @Component
9
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: `<h1>Hello World</h1>`
})
export class AppComponent { }
Angular2 ecosystem
• @Component (Styling)
10
// Styles in Metadata
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: `<h1>Test</h1>`,
styles: [` h1 { color: red } `]
})
export class AppComponent {}
// Style URLs in Metadata
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: `<h1>Test</h1>`,
styleUrls: [ 'app/app.component.css' ]
})
export class AppComponent {}
Angular2 ecosystem
• @Component (Lifecycle)
11
import { Component, OnInit, OnDestroy } from
'@angular/core';
@Component({
selector: 'my-app',
template: `<h1>Test</h1>`
})
export class AppComponent implements OnInit, OnDestroy {
ngOnInit() { }
ngOnDestroy() { }
}
Angular2 ecosystem
• @Component
• @NgModule
12
// decorator defines the metadata for the module
import { NgModule } from '@angular/core';
// application service providers, common directives
import { BrowserModule } from '@angular/platform-browser';
// root component
import { AppComponent } from './app.component';
@NgModule({
imports: [ BrowserModule ], // importing other modules
declarations: [ AppComponent ], // components, directives that are part of this module
bootstrap: [ AppComponent ] // root component that Angular should bootstrap
})
export class AppModule { }
Angular2 ecosystem
• @Component
• @NgModule
• Bootstrap application
13
// Angular's browser platformBrowserDynamic function
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
// application module
import { AppModule } from './app.module';
// bootstrapping
platformBrowserDynamic().bootstrapModule(AppModule);
Angular2 ecosystem
• @Component
• @NgModule
• Bootstrap application
• Services
14
import { Injectable } from '@angular/core';
@Injectable()
export class AppService {
getUsers(): any[] {
return []
}
}
Angular2 ecosystem
• @Component
• @NgModule
• Bootstrap application
• Services (DI)
15
@NgModule({
imports: [ BrowserModule ],
declarations: [ AppComponent],
bootstrap: [ AppComponent ],
providers: [ AppService ]
})
export class AppModule { }
import { Component, OnInit } from '@angular/core';
import {AppService} from './app.service'
@Component({
selector: 'my-app',
templateUrl: 'app.component.html',
providers: [AppService]
})
export class AppComponent implements OnInit {
users: any[]
// Angular Dependency Injection
constructor( private appService: AppService){}
// Using service
ngOnInit() {
this.users = this.appService.getUsers();
}
}
Angular2 ecosystem
• @Component
• @NgModule
• Bootstrap application
• Services
• routing, pipes, forms, http, animations…
16
Component Architecture
17
Component Architecture
• Thinking in React Components (link)
18
19
Component Architecture
• Thinking in React Components (link)
• One way data flow
20
21
demo
22
Angular CLI
23
Angular CLI (GitHub)
• create a project from scratch
• scaffold components, directives, services, etc.
• lint your code
• serve the application
• run your unit tests and end to end tests.
24
Components in Angular 1
25
from Directives to Components
26
app.directive('myApp', function () {
return {
template: '<div>{{ctrl.name}}</div>',
scope: {
name: '='
},
controller: function () {
this.name = 'John'
},
controllerAs: 'ctrl',
bindToController: true
};
});
app.component('myApp', {
template: '<div>{{$ctrl.name}}</div>',
binding: {
name: '<' // one-way binding
},
controller: function () {
this.name = 'John'
}
});
from Directives to Components
27
• Components have a well-defined public API - Inputs and Outputs
– Inputs should be using < and @ bindings
– Outputs are realized with & bindings
• Components have a well-defined lifecycle
– $onInit()
– $onChanges(changesObj)
– $doCheck()
– $onDestroy()
– $postLink()
• An application is a tree of components (minimize two-way data
binding)
Thank You
28

More Related Content

What's hot (20)

PDF
The evolution of Angular 2 @ AngularJS Munich Meetup #5
Johannes Weber
 
PDF
An introduction to Angular2
Apptension
 
PPTX
Migrating an application from Angular 1 to Angular 2
Ross Dederer
 
PDF
Angular2 - getting-ready
Nir Kaufman
 
PPTX
Angular 2 - a New Hope
Sami Suo-Heikki
 
PDF
Angular 2 - The Next Framework
Commit University
 
PDF
The productive developer guide to Angular 2
Maurice De Beijer [MVP]
 
PPTX
AngularJS2 / TypeScript / CLI
Domenico Rutigliano
 
PDF
Quick introduction to Angular 4 for AngularJS 1.5 developers
Paweł Żurowski
 
PDF
Building Universal Applications with Angular 2
Minko Gechev
 
ODP
Building scalable modular app with Angular2 concept
kzw
 
PDF
Angular 2 Essential Training
Patrick Schroeder
 
PDF
Angular 2... so can I use it now??
Laurent Duveau
 
ODP
Introduction to Angular 2
Knoldus Inc.
 
PDF
Migrating to Angular 2
FITC
 
PPTX
Angular 2
Nigam Goyal
 
PDF
Adventures with Angular 2
Dragos Ionita
 
PDF
Introduction to Angular 2
Dawid Myslak
 
PDF
Angular 2 Crash Course
Elisha Kramer
 
PDF
Express: A Jump-Start
Naveen Pete
 
The evolution of Angular 2 @ AngularJS Munich Meetup #5
Johannes Weber
 
An introduction to Angular2
Apptension
 
Migrating an application from Angular 1 to Angular 2
Ross Dederer
 
Angular2 - getting-ready
Nir Kaufman
 
Angular 2 - a New Hope
Sami Suo-Heikki
 
Angular 2 - The Next Framework
Commit University
 
The productive developer guide to Angular 2
Maurice De Beijer [MVP]
 
AngularJS2 / TypeScript / CLI
Domenico Rutigliano
 
Quick introduction to Angular 4 for AngularJS 1.5 developers
Paweł Żurowski
 
Building Universal Applications with Angular 2
Minko Gechev
 
Building scalable modular app with Angular2 concept
kzw
 
Angular 2 Essential Training
Patrick Schroeder
 
Angular 2... so can I use it now??
Laurent Duveau
 
Introduction to Angular 2
Knoldus Inc.
 
Migrating to Angular 2
FITC
 
Angular 2
Nigam Goyal
 
Adventures with Angular 2
Dragos Ionita
 
Introduction to Angular 2
Dawid Myslak
 
Angular 2 Crash Course
Elisha Kramer
 
Express: A Jump-Start
Naveen Pete
 

Viewers also liked (8)

PDF
A Story about AngularJS modularization development
Johannes Weber
 
PDF
Formular handling in AngularJS
Johannes Weber
 
PDF
Angular2 intro
Shawn McKay
 
PDF
An Intro to Angular 2
Ron Heft
 
PDF
Angular 2 overview
Jesse Warden
 
PDF
Progressive Web Apps
Johannes Weber
 
PDF
Getting Started with Angular 2
FITC
 
PDF
Angular 2 - Core Concepts
Fabio Biondi
 
A Story about AngularJS modularization development
Johannes Weber
 
Formular handling in AngularJS
Johannes Weber
 
Angular2 intro
Shawn McKay
 
An Intro to Angular 2
Ron Heft
 
Angular 2 overview
Jesse Warden
 
Progressive Web Apps
Johannes Weber
 
Getting Started with Angular 2
FITC
 
Angular 2 - Core Concepts
Fabio Biondi
 
Ad

Similar to Introduction to Angular2 (20)

PPTX
Building a TV show with Angular, Bootstrap, and Web Services
David Giard
 
PDF
Meetup SkillValue - Angular 6 : Bien démarrer son application
Thibault Even
 
PDF
Commit University - Exploring Angular 2
Commit University
 
PPTX
Angular js 2
Ran Wahle
 
PDF
What is your money doing?
Alfonso Fernández
 
PDF
ChtiJUG - Introduction à Angular2
Demey Emmanuel
 
PDF
better-apps-angular-2-day1.pdf and home
ChethanGowda886434
 
PPTX
Angular 2.0
Mallikarjuna G D
 
PDF
Technozaure - Angular2
Demey Emmanuel
 
PPTX
Moving From AngularJS to Angular 2
Exilesoft
 
PPTX
Angular 2 Migration - JHipster Meetup 6
William Marques
 
PPTX
Angular IO
Jennifer Estrada
 
PDF
Angular 2 for Java Developers
Yakov Fain
 
PPTX
Angular 2 in-1
GlobalLogic Ukraine
 
PDF
Angular 4 for Java Developers
Yakov Fain
 
PDF
Bootiful Development with Spring Boot and Angular - RWX 2018
Matt Raible
 
PDF
はじめてのAngular2
Kenichi Kanai
 
PDF
From MEAN to the MERN Stack
Troy Miles
 
PDF
The productive developer guide to Angular 2
Maurice De Beijer [MVP]
 
PPTX
angular-concepts-introduction-slides.pptx
shekharmpatil1309
 
Building a TV show with Angular, Bootstrap, and Web Services
David Giard
 
Meetup SkillValue - Angular 6 : Bien démarrer son application
Thibault Even
 
Commit University - Exploring Angular 2
Commit University
 
Angular js 2
Ran Wahle
 
What is your money doing?
Alfonso Fernández
 
ChtiJUG - Introduction à Angular2
Demey Emmanuel
 
better-apps-angular-2-day1.pdf and home
ChethanGowda886434
 
Angular 2.0
Mallikarjuna G D
 
Technozaure - Angular2
Demey Emmanuel
 
Moving From AngularJS to Angular 2
Exilesoft
 
Angular 2 Migration - JHipster Meetup 6
William Marques
 
Angular IO
Jennifer Estrada
 
Angular 2 for Java Developers
Yakov Fain
 
Angular 2 in-1
GlobalLogic Ukraine
 
Angular 4 for Java Developers
Yakov Fain
 
Bootiful Development with Spring Boot and Angular - RWX 2018
Matt Raible
 
はじめてのAngular2
Kenichi Kanai
 
From MEAN to the MERN Stack
Troy Miles
 
The productive developer guide to Angular 2
Maurice De Beijer [MVP]
 
angular-concepts-introduction-slides.pptx
shekharmpatil1309
 
Ad

Recently uploaded (20)

PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
Digital Circuits, important subject in CS
contactparinay1
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 

Introduction to Angular2

  • 1. AN INTRODUCTION TO ANGULAR 2 Ivan Matiishyn Senior front-end developer @DataArt 2016
  • 2. Agenda 1. What is Angular2 2. TypeScript 3. Angular2 ecosystem 4. Component Architecture
  • 4. What is Angular2? • JavaScript framework for SPA (link) • DI, Change Detection • Everything you need for complex app • Current state - RC5 • Server-side Rendering (link) • Lazy Loading • Native App Support (link) • Web Workers 4
  • 7. TypeScript Types: • string • number • boolean • Array • any • Custom types 7 Tools: • VS Code • Playground (link)
  • 9. Angular2 ecosystem • @Component 9 import { Component } from '@angular/core'; @Component({ selector: 'my-app', template: `<h1>Hello World</h1>` }) export class AppComponent { }
  • 10. Angular2 ecosystem • @Component (Styling) 10 // Styles in Metadata import { Component } from '@angular/core'; @Component({ selector: 'my-app', template: `<h1>Test</h1>`, styles: [` h1 { color: red } `] }) export class AppComponent {} // Style URLs in Metadata import { Component } from '@angular/core'; @Component({ selector: 'my-app', template: `<h1>Test</h1>`, styleUrls: [ 'app/app.component.css' ] }) export class AppComponent {}
  • 11. Angular2 ecosystem • @Component (Lifecycle) 11 import { Component, OnInit, OnDestroy } from '@angular/core'; @Component({ selector: 'my-app', template: `<h1>Test</h1>` }) export class AppComponent implements OnInit, OnDestroy { ngOnInit() { } ngOnDestroy() { } }
  • 12. Angular2 ecosystem • @Component • @NgModule 12 // decorator defines the metadata for the module import { NgModule } from '@angular/core'; // application service providers, common directives import { BrowserModule } from '@angular/platform-browser'; // root component import { AppComponent } from './app.component'; @NgModule({ imports: [ BrowserModule ], // importing other modules declarations: [ AppComponent ], // components, directives that are part of this module bootstrap: [ AppComponent ] // root component that Angular should bootstrap }) export class AppModule { }
  • 13. Angular2 ecosystem • @Component • @NgModule • Bootstrap application 13 // Angular's browser platformBrowserDynamic function import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; // application module import { AppModule } from './app.module'; // bootstrapping platformBrowserDynamic().bootstrapModule(AppModule);
  • 14. Angular2 ecosystem • @Component • @NgModule • Bootstrap application • Services 14 import { Injectable } from '@angular/core'; @Injectable() export class AppService { getUsers(): any[] { return [] } }
  • 15. Angular2 ecosystem • @Component • @NgModule • Bootstrap application • Services (DI) 15 @NgModule({ imports: [ BrowserModule ], declarations: [ AppComponent], bootstrap: [ AppComponent ], providers: [ AppService ] }) export class AppModule { } import { Component, OnInit } from '@angular/core'; import {AppService} from './app.service' @Component({ selector: 'my-app', templateUrl: 'app.component.html', providers: [AppService] }) export class AppComponent implements OnInit { users: any[] // Angular Dependency Injection constructor( private appService: AppService){} // Using service ngOnInit() { this.users = this.appService.getUsers(); } }
  • 16. Angular2 ecosystem • @Component • @NgModule • Bootstrap application • Services • routing, pipes, forms, http, animations… 16
  • 18. Component Architecture • Thinking in React Components (link) 18
  • 19. 19
  • 20. Component Architecture • Thinking in React Components (link) • One way data flow 20
  • 21. 21
  • 24. Angular CLI (GitHub) • create a project from scratch • scaffold components, directives, services, etc. • lint your code • serve the application • run your unit tests and end to end tests. 24
  • 26. from Directives to Components 26 app.directive('myApp', function () { return { template: '<div>{{ctrl.name}}</div>', scope: { name: '=' }, controller: function () { this.name = 'John' }, controllerAs: 'ctrl', bindToController: true }; }); app.component('myApp', { template: '<div>{{$ctrl.name}}</div>', binding: { name: '<' // one-way binding }, controller: function () { this.name = 'John' } });
  • 27. from Directives to Components 27 • Components have a well-defined public API - Inputs and Outputs – Inputs should be using < and @ bindings – Outputs are realized with & bindings • Components have a well-defined lifecycle – $onInit() – $onChanges(changesObj) – $doCheck() – $onDestroy() – $postLink() • An application is a tree of components (minimize two-way data binding)

Editor's Notes

  • #2: Hi guys! My name is Ivan, I work as a front-end developer at DataArt Wroclaw
  • #3: And today we are gonna be talking about the Angular2. What is it, Quickly review the TypeScript And discover the NG2 ecosystem After that we’ll take a look at the architectural approach of building ng2 apps
  • #4: Now, before we begin, please let me know, how many of you have any experience with Angular 1? Nice. So, you are familiar with some concepts like routing, services, directives, and SPA.
  • #5: First of all it’s a JS framework for building SPAs it was rewritten from scratch, improved DI and new Change detection – no more $digest cycles Two weeks ago the RC5 was released with some big changes in there, like modules [universal] a full solution for universal rendering, which means that the initial view of the application can be rendered on a server and shipped as fully populated HTML. Lazy loading - It comes with a router that supports lazily loading the code for routes only when they're first accessed – Lacked in NG1 Native App Support –you can build a cross-platform iOS and Android app with Angular2 and NativeScript and you can build desktop applications using Ng2 and Electron Web Workers - you can configure Angular 2 so that most of your application code runs in a Web Worker
  • #6: Before showing any Angular2 code I’d like to quickly review a TypeScript.
  • #7: The language we usually call "JavaScript" is formally known as "EcmaScript". ES5 - The 5th edition of ECMAScript, standardized in 2009. This standard has been implemented in all modern browsers ES6 - The 6th edition of ECMAScript, standardized in 2015. This standard has been partially implemented in most modern browsers. It has a lot of cool features, like classes, arrow functions, template strings, module s Does any of you guys use ES6 in your real projects? ES7 – there’s a proposal of es2016 And the TypeScript – which is not a new language but just a superset of JavaScript, that supports all latest features of ES and adds opional typings [FOR EXAMPLE – VS CODE]
  • #8: Here are different types in TS, let’s take a look at some of them: s, n, b, A, or it can be ‘any’ if you are not sure or you can create your own type - Interface Interfaces are abstract descriptions of things, and can be used to represent any non-primitive JavaScript object. They produce no code (ES6 or ES5), and exist only to describe types to tsc. Here’s an example: And that’s pretty much it
  • #9: Now, Let’s see what do we have in ng2. Let’s dive into the ecosystem
  • #10: NG2 is all about components. The whole application can be modelled as a tree of these components. This is how it looks like [CODE] Every Angular app has at least one root component. Components are the basic building blocks of Angular applications. A component controls a portion of the screen, it’s has it’s own template, styles. @Component is a decorator that allows us to associate metadata with the component class. The metadata tells Angular how to create and use this component. TEMPLATES You can write templates inline here or move it to a separate file, let’s do that
  • #11: Let’s see how we can style any component There are several ways to add styling to your components 1. we can write inline 2. Style URLs in Metadata One more important thing about Component styles: the selectors we put into a component's styles only apply within the template of that component. Component CSS styles are encapsulated into the component's own view and do not affect the rest of the application.
  • #12: A Component has a lifecycle managed by Angular itself. Angular creates it, renders it, creates and renders its children, checks it when its data-bound properties change, and destroys it before removing it from the DOM. And here’s how it can be implemented [CODE]
  • #13: every Component should be part of a module, and every app requires at least one module This feature was introduced in the latest RC about 2 weeks ago Many Angular libraries and third party libraries are modules as well. Similar to what we have in ng1, we find new module, download and include it and directives are available throughout an application. As the app grows, we refactor the root module into feature modules that represent collections of related functionality. We then import these modules into the root module.
  • #14: Now let’s see how we can actually run the application We need to import the main module of application and a function to bootstrap it. It’s because Bootstrapping is platform-specific, you may load a module in a different environment, it may be the Cordova or NativeScript for mobile applications or We might wish to render the first page of our application on the server to improve launch performance or facilitate SEO And It’s better to have a separate file for this process at least for separation of concerns.
  • #15: Next important feature is a Service As you have an Angular 1 background then you are familiar with this concept, but in NG2 it’s much simplier : there’s no more service/factory. In Angular 2 there are only services, and they are just vanilla ES6 classes. And to make that service injectable into other services and components we need to decorate the class with Injectable function [CODE]
  • #16: And the way to use Services: firs of all you have to register it, you can now register services in the module level to be used throughout a whole module. Or you can register your service in the Component level and it’ll be available to that component and its children. Here’s the usage
  • #17: There’re much more stuff to check but I’d like to get back to Components and take a quick look at the way of building applications from Architectural perspective.
  • #18: So let’s take a look how to build applications using Component Architecture.
  • #19: If you ever started learning ReactJS then you’ve probably seen this article – “Thinking in React”. But the Step One can be applied not only to React, it’s actually a short explanation of the “Component Architecture”, which says that your application should be a tree of small components.
  • #20: Let’s say we are creating a simple application that has a list of users, search and info about a selected user [1]. Now we need to split all features into separate components, like this [2] But during development you will notice that <userEdit> is not enough for such a big component so better to create few more components, like this [3] Those components have blue background because they are so-called presentational components (stateless, dumb). They don’t know how to read or write data. They receive data via property binding and they output data via events. While those white components are Containers (or stateful or smart) components. They can communicate with services and render child components. It’s useful
  • #21: And The data flow. Angular 2 change detection enforces a uni-directional data flow. It runs and updates the view when the data on our classes gets updated.
  • #22: By default, Angular 1 implemented two-way data binding, the flow of changes is pretty much chaotic, anything could change anything else. In NG2 the flow of information is unidirectional. As I said, component receive data via property binding and they output data via events.
  • #24: And there’s one more tool worth mentioning here – Angular CLI
  • #25: f you don’t want to spend much time configuring your building and testing processes then you should definitely consider it I wanted to show it to you in action but it doesn’t support RC5, so no modules, bootstrapping Let’s see it in action
  • #27: In Angular, a Component is a special kind of directive that uses a simpler configuration which is suitable for a component-based application structure. This makes it easier to use Angular 2's style of application architecture.
  • #28: $onInit() - after all the controllers on an element have been constructed and had their bindings initialized $onChanges(changesObj) - Called whenever one-way bindings are updated. $doCheck() - Called on each turn of the digest cycle. $onDestroy() - Called on a controller when its containing scope is destroyed. $postLink() - Called after this controller's element and its children have been linked. ngAfterViewInit, content