SlideShare une entreprise Scribd logo
1  sur  57
Télécharger pour lire hors ligne
준비하세요 
AngularJS 2.0
+jeado.ko 
haibane84@gmail.com
현재 버젼 
AngularJS 1.3
Motivation for AngularJS 2.0 
● 성능 
● 웹의 변화 
● 쓰기 편함
성능 
최초 AngularJS는 디자이너를 위해 만들어 졌 
다.
웹의 변화 
ES6 
Web Components 
● Custom Elements 
● HTML Imports 
● Template Element 
● Shadow Dom
쓰기 어려움 
출처 http://www.bennadel.com/blog/2439-my-experience-with-angularjs- 
the-super-heroic-javascript-mvw-framework.htm
AngularJS 2.0의 새로운 기능
AtScript
AtScript? 
언어를 만드는거냐? 
더 어렵게 만들려는 수작이야?
module.directive('blink', 
['$timeout', function($timeout) { 
return { 
require: 'options', 
restrict: 'A', 
link: function(_,element,__,options){ 
var selectors = someThirdPartyAPI(); 
element.query(selectors.join(',')) 
.forEach(e => options.apply(e)); 
} 
}; 
}]);
module.directive('blink', 
['$timeout', function($timeout) { 
return { 
require: 'options', 
restrict: 'A', 
link: function(_,element,__,options){ 
var selectors = someThirdPartyAPI(); 
element.query(selectors.join(',')) 
.forEach(e => options.apply(e)); 
} 
}; 
}]);
module.directive('blink', 
['$timeout', function($timeout) { 
return { 
require: 'options', 
restrict: 'A', 
link: function(_,element,__,options){ 
var selectors = someThirdPartyAPI(); 
element.query(selectors.join(',')) 
.forEach(e => options.apply(e)); 
} 
}; 
}]); 
Array<CssSelectors> 
Element
@Directive({ 
selector: ['[blink]'] 
}) 
class Blink { 
constructor(element:Element, 
options:Options, 
timeout:Timeout) { 
var selectors:Array<CssSelectors> = 
someThirdPartyAPI(); 
element.query(selectors.join(',')) 
.forEach(e => options.apply(e)); 
} 
}
Ideal Development Environment 
Optional Metadata 
Types 
AtScript 
Introspection
ES3 '99 
- try/catch 
- RegExp 
ES4 '07 
- Types 
- Classes 
- Modules 
- (other) 
ES5 '09 
- strict mode 
ES6 '15 
- Classes 
- Modules 
- (other) 
ES? '?? 
- Types 
- Annotation 
- Introspection
AtScript 
- Annotations 
- Introspection 
TypeScript 
- Types 
ES6 
- classes 
- modules 
ES5
ES5 
function Blink(element, 
options, 
timeout) { 
} 
Blink.annotations = [ 
new Directive({selector: '[blink]'})]; 
Blink.parameters = [ 
Element, Options, Timeout];
ES6 
class Blink { 
constructor(element, 
options, 
timeout) { 
} 
} 
Blink.annotations = [ 
new Directive({selector: '[blink]'})]; 
Blink.parameters = [ 
Element, Options, Timeout];
TypeScript 
class Blink { 
public static annotations = [ 
new Directive({selector: '[blink]'})]; 
public static parameters = [ 
Element, Options, Timeout]; 
constructor(element:Element, 
options:Options, 
timeout:Timeout) { } 
}
AtScript 
@Directive({ 
selector: '[blink]' 
}) 
class Blink { 
constructor(element:Element, 
options:Options, 
timeout:Timeout) { 
} 
}
CoffeeScript 
class Blink { 
@annotations = [ 
new Directive({selector: '[blink]'})]; 
@parameters = [ 
Element, Options, Timeout]; 
constructor: (element, options, timeout){ 
} 
}
AtScript != new language 
AtScript = ES6 
+ Types 
+ Annotations 
+ Introspections
Template
AngularJS 1.3 
<div ng-controller="SantaTodoController"> 
<input type="text" ng-model="newTodoTitle"> 
<button ng-click="addTodo()">+</button> 
<tab-container> 
<tab-pane title="Tobias"> 
<div ng-repeat="todo in todosOf('tobias')"> 
<input type="checkbox" 
ng-model="todo.done"> 
{{todo.title}} 
<button ng-click="deleteTodo(todo)"> 
X 
</button> 
</div> 
</tab-pane> 
...
AngularJS 2.0 
<div> 
<input type="text" [value]="newTodoTitle"> 
<button (click)="addTodo()">+</buton> 
<tab-container> 
<tab-pane title="Good kids"> 
<div [ng-repeat|todo]="todosOf('good')"> 
<input type="checkbox" 
[checked]="todo.done"> 
{{todo.title}} 
<button (click)="deleteTodo(todo)"> 
X 
</button> 
</div> 
</tab-pane> 
...
Event binding 
<button (click)="doSomething()">click me</button> 
<div (^click)="doSomithing"> 
<img src="..."><span>text</span> 
</div> 
<zippy #zippy title="Greeting"> 
Body of the text which is shown conditionally. 
<a href (hover)="zippy.close()">hover to close</a>. 
</zippy> 
<button (click)="zippy.toggle()">toggle</button>
AngularJS 2.0 
<div> 
<input type="text" [value]="newTodoTitle"> 
<button (click)="addTodo()">+</buton> 
<tab-container> 
<tab-pane title="Good kids"> 
<div [ng-repeat|todo]="todosOf('good')"> 
<input type="checkbox" 
[checked]="todo.done"> 
{{todo.title}} 
<button (click)="deleteTodo(todo)"> 
X 
</button> 
</div> 
</tab-pane> 
...
Property binding 
<div [property-name]="expression"> 
<div [ng-repeat|person]="people"> 
<span [text]="person.name"></span> 
</div>
AngularJS 2.0 
<div> 
<input type="text" [value]="newTodoTitle"> 
<button (click)="addTodo()">+</buton> 
<tab-container> 
<tab-pane title="Good kids"> 
<div [ng-repeat|todo]="todosOf('good')"> 
<input type="checkbox" 
[checked]="todo.done"> 
{{todo.title}} 
<button (click)="deleteTodo(todo)"> 
X 
</button> 
</div> 
</tab-pane> 
...
AngularJS 2.0 
<div> 
<input type="text" [value]="newTodoTitle"> 
<button (click)="addTodo()">+</buton> 
<tab-container> 
<tab-pane title="Good kids"> 
<div [ng-repeat|todo]="todosOf('good')"> 
<input type="checkbox" 
[checked]="todo.done"> 
{{todo.title}} 
<button (click)="deleteTodo(todo)"> 
X 
</button> 
</div> 
</tab-pane> 
...
Databinding 
Databinding to 
Element`s properties 
not to 
Element`s attributes 
<elm attr=”...”> elm.property=...
Controller
controllers 
2009-2014
Components 
= Building block 
(LEGO)
<ng-search-icon> 
<ng-paper-fab> 
<ng-drawer-panel> 
<ng-field>
Directive Definition Object ("DDO") 
myModule.directive('directiveName', function factory(injectables) { 
return { 
priority: 0, 
template: '<div></div>', // or // function(tElement, tAttrs) { ... }, 
// or 
// templateUrl: 'directive.html', // or // function(tElement, tAttrs) { ... }, 
transclude: false, 
restrict: 'A', 
templateNamespace: 'html', 
scope: false, 
controller: function($scope, $element, $attrs, $transclude, otherInjectables) { ... 
}, 
controllerAs: 'stringAlias', 
require: 'siblingDirectiveName', // or // ['^parentDirectiveName', '? 
optionalDirectiveName', '?^optionalParent'], 
compile: function compile(tElement, tAttrs, transclude) { 
return { 
pre: function preLink(scope, iElement, iAttrs, controller) { ... }, 
post: function postLink(scope, iElement, iAttrs, controller) { ... } 
} 
// or 
// return function postLink( ... ) { ... }
Component = Directive … 
그 지저분한 Directive 만 가지고 
만들라고?
Directive
DDO 
2009-2014
SantaTodoApp component 
@ComponentDirective 
class SantaTodoApp { 
constructor() { 
this.newTodoTitle = ''; 
} 
addTodo: function() { ... } 
removeTodo: function(todo) { ... } 
todosOf: function(filter) { ... } 
}
SantaTodoApp component 
@ComponentDirective({ ... }) 
class SantaTodoApp { ... } 
@TemplateDirective({ ... }) 
class NgRepeat { ... } 
@DecoratorDirective({ ... }) 
class NgClass { ... }
SantaTodoApp component 
@ComponentDirective 
class SantaTodoApp { 
constructor() { 
this.newTodoTitle = ''; 
} 
addTodo: function() { ... } 
removeTodo: function(todo) { ... } 
todosOf: function(filter) { ... } 
}
어? $scope 은 어딨지?
$scope 
2009-2014
Component is the execution 
context for the template 
컴포넌트의 모든 속성과 메소 
드는 템플릿에서 사용할 수 있 
다.
Dependency Injection
Defining services 
class TodoStore { 
constructor(win:Window) { 
this.win = win; 
} 
add(todo) { 
// access this.win.localStorage ... 
} 
remove(todo) { ... } 
todosOf(filter) { ... } 
}
angular 
.module 
2009-2014
Using services 
import {TodoStore} from './store'; 
@ComponentDirective({ 
directives: [TabContainer, TabPane, NgRepeat] 
}) 
class SantaTodoApp { 
constructor(store:TodoStore) { 
... 
} 
... 
}
Directives and DI 
<tab-container> 
<tab-pane title="Tobias"> 
New Macbook Pro 
Tesla Model X 
... 
</tab-pane> 
<tab-pane title="Good kids"> 
... 
</tab-pane> 
<tab-pane title="Bad kids"> 
... 
</tab-pane> 
</tab-container>
Directives and DI 
class TabPane { 
constructor( 
tabContainer:TabContainer, 
element:HTMLElement 
) { ... } 
... 
} 
class TabContainer { 
constructor(tabs:Query<TabPane>) { ... } 
... 
}
요약 
사망 : Controller, $scope, DDO, Module, jqLite 
출생 : AtScript, Web Component 지원, more? 
다이어트를 했다?
Angular 2.0 Source 
https://github.com/angular/angular
reference 
Angular 2.0 Core by Igor Minar & Tobias Bosch at ng-europe 2014(Youtube) 
Miško Hevery - Keynote on AtScript at ng-europe 2014 (Youtube) 
Angular v2 Template Syntax Summary (Google Doc) 
Databinding with Web Components (Google Doc)

Contenu connexe

Tendances

Practical AngularJS
Practical AngularJSPractical AngularJS
Practical AngularJSWei Ru
 
AngularJS for designers and developers
AngularJS for designers and developersAngularJS for designers and developers
AngularJS for designers and developersKai Koenig
 
Angularjs architecture
Angularjs architectureAngularjs architecture
Angularjs architectureMichael He
 
AngularJS: an introduction
AngularJS: an introductionAngularJS: an introduction
AngularJS: an introductionLuigi De Russis
 
Modules and injector
Modules and injectorModules and injector
Modules and injectorEyal Vardi
 
Upgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.xUpgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.xEyal Vardi
 
AngularJs $provide API internals & circular dependency problem.
AngularJs $provide API internals & circular dependency problem.AngularJs $provide API internals & circular dependency problem.
AngularJs $provide API internals & circular dependency problem.Yan Yankowski
 
Angular 2.0 Routing and Navigation
Angular 2.0 Routing and NavigationAngular 2.0 Routing and Navigation
Angular 2.0 Routing and NavigationEyal Vardi
 
Workshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte IWorkshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte IVisual Engineering
 
Performance Optimization In Angular 2
Performance Optimization In Angular 2Performance Optimization In Angular 2
Performance Optimization In Angular 2Eyal Vardi
 
AngularJS Beginners Workshop
AngularJS Beginners WorkshopAngularJS Beginners Workshop
AngularJS Beginners WorkshopSathish VJ
 
AngularJS Architecture
AngularJS ArchitectureAngularJS Architecture
AngularJS ArchitectureEyal Vardi
 
Angular 2.0 forms
Angular 2.0 formsAngular 2.0 forms
Angular 2.0 formsEyal Vardi
 

Tendances (20)

AngularJS Basics with Example
AngularJS Basics with ExampleAngularJS Basics with Example
AngularJS Basics with Example
 
Practical AngularJS
Practical AngularJSPractical AngularJS
Practical AngularJS
 
AngularJs
AngularJsAngularJs
AngularJs
 
AngularJS for designers and developers
AngularJS for designers and developersAngularJS for designers and developers
AngularJS for designers and developers
 
Angularjs architecture
Angularjs architectureAngularjs architecture
Angularjs architecture
 
AngularJS Framework
AngularJS FrameworkAngularJS Framework
AngularJS Framework
 
AngularJS: an introduction
AngularJS: an introductionAngularJS: an introduction
AngularJS: an introduction
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Modules and injector
Modules and injectorModules and injector
Modules and injector
 
Angular js architecture (v1.4.8)
Angular js architecture (v1.4.8)Angular js architecture (v1.4.8)
Angular js architecture (v1.4.8)
 
Upgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.xUpgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.x
 
AngularJs $provide API internals & circular dependency problem.
AngularJs $provide API internals & circular dependency problem.AngularJs $provide API internals & circular dependency problem.
AngularJs $provide API internals & circular dependency problem.
 
Angular 2.0 Routing and Navigation
Angular 2.0 Routing and NavigationAngular 2.0 Routing and Navigation
Angular 2.0 Routing and Navigation
 
Workshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte IWorkshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte I
 
AngularJS
AngularJSAngularJS
AngularJS
 
Performance Optimization In Angular 2
Performance Optimization In Angular 2Performance Optimization In Angular 2
Performance Optimization In Angular 2
 
Nicolas Embleton, Advanced Angular JS
Nicolas Embleton, Advanced Angular JSNicolas Embleton, Advanced Angular JS
Nicolas Embleton, Advanced Angular JS
 
AngularJS Beginners Workshop
AngularJS Beginners WorkshopAngularJS Beginners Workshop
AngularJS Beginners Workshop
 
AngularJS Architecture
AngularJS ArchitectureAngularJS Architecture
AngularJS Architecture
 
Angular 2.0 forms
Angular 2.0 formsAngular 2.0 forms
Angular 2.0 forms
 

En vedette

Angularjs 도입 선택 가이드
Angularjs 도입 선택 가이드Angularjs 도입 선택 가이드
Angularjs 도입 선택 가이드NAVER D2
 
AngularJS 2, version 1 and ReactJS
AngularJS 2, version 1 and ReactJSAngularJS 2, version 1 and ReactJS
AngularJS 2, version 1 and ReactJSKenneth Ceyer
 
Front end dev 2016 & beyond
Front end dev 2016 & beyondFront end dev 2016 & beyond
Front end dev 2016 & beyondJae Sung Park
 
Angular 2 어디까지 왔을까
Angular 2 어디까지 왔을까Angular 2 어디까지 왔을까
Angular 2 어디까지 왔을까장현 한
 
Angular2를 활용한 컴포넌트 중심의 개발
Angular2를 활용한 컴포넌트 중심의 개발Angular2를 활용한 컴포넌트 중심의 개발
Angular2를 활용한 컴포넌트 중심의 개발Jin wook
 
Angular js 2.0 preview
Angular js 2.0 previewAngular js 2.0 preview
Angular js 2.0 preview학섭 오
 
Angular2 가기전 Type script소개
 Angular2 가기전 Type script소개 Angular2 가기전 Type script소개
Angular2 가기전 Type script소개Dong Jun Kwon
 
How to make beer in House
How to make beer in HouseHow to make beer in House
How to make beer in HouseChan-uk Son
 
ECMAScript 6의 새로운 것들!
ECMAScript 6의 새로운 것들!ECMAScript 6의 새로운 것들!
ECMAScript 6의 새로운 것들!WooYoung Cho
 
The role of Payroll is preparation and processing of Auto Enrolment - Sage at...
The role of Payroll is preparation and processing of Auto Enrolment - Sage at...The role of Payroll is preparation and processing of Auto Enrolment - Sage at...
The role of Payroll is preparation and processing of Auto Enrolment - Sage at...Sageukofficial
 
Electronics bits
Electronics bitsElectronics bits
Electronics bitsDr.YNM
 
Ett lyft för skolbiblioteket 110407 i Tammerfors
Ett lyft för skolbiblioteket 110407 i TammerforsEtt lyft för skolbiblioteket 110407 i Tammerfors
Ett lyft för skolbiblioteket 110407 i TammerforsStockholms stad
 
U Clubsocialmedifinal
U ClubsocialmedifinalU Clubsocialmedifinal
U ClubsocialmedifinalSarah Durham
 
Fail to prepare - Softworld 2011
Fail to prepare -  Softworld 2011Fail to prepare -  Softworld 2011
Fail to prepare - Softworld 2011Sageukofficial
 
Does the Internet harm children's health? A critical review of the evidence
Does the Internet harm children's health? A critical review of the evidenceDoes the Internet harm children's health? A critical review of the evidence
Does the Internet harm children's health? A critical review of the evidenceMonica Bulger
 
Bren Poster Presentation Workshop
Bren Poster Presentation WorkshopBren Poster Presentation Workshop
Bren Poster Presentation WorkshopMonica Bulger
 
CREATE 0708 Intro
CREATE 0708 IntroCREATE 0708 Intro
CREATE 0708 Intronewgnij
 

En vedette (20)

Angularjs 도입 선택 가이드
Angularjs 도입 선택 가이드Angularjs 도입 선택 가이드
Angularjs 도입 선택 가이드
 
AngularJS 2, version 1 and ReactJS
AngularJS 2, version 1 and ReactJSAngularJS 2, version 1 and ReactJS
AngularJS 2, version 1 and ReactJS
 
Front end dev 2016 & beyond
Front end dev 2016 & beyondFront end dev 2016 & beyond
Front end dev 2016 & beyond
 
Angular 2 어디까지 왔을까
Angular 2 어디까지 왔을까Angular 2 어디까지 왔을까
Angular 2 어디까지 왔을까
 
현실적 PWA
현실적 PWA현실적 PWA
현실적 PWA
 
Angular2를 활용한 컴포넌트 중심의 개발
Angular2를 활용한 컴포넌트 중심의 개발Angular2를 활용한 컴포넌트 중심의 개발
Angular2를 활용한 컴포넌트 중심의 개발
 
Angular js 2.0 preview
Angular js 2.0 previewAngular js 2.0 preview
Angular js 2.0 preview
 
Angular2 가기전 Type script소개
 Angular2 가기전 Type script소개 Angular2 가기전 Type script소개
Angular2 가기전 Type script소개
 
How to make beer in House
How to make beer in HouseHow to make beer in House
How to make beer in House
 
ECMAScript 6의 새로운 것들!
ECMAScript 6의 새로운 것들!ECMAScript 6의 새로운 것들!
ECMAScript 6의 새로운 것들!
 
The role of Payroll is preparation and processing of Auto Enrolment - Sage at...
The role of Payroll is preparation and processing of Auto Enrolment - Sage at...The role of Payroll is preparation and processing of Auto Enrolment - Sage at...
The role of Payroll is preparation and processing of Auto Enrolment - Sage at...
 
Líderes Mundiais no Instagram
Líderes Mundiais no InstagramLíderes Mundiais no Instagram
Líderes Mundiais no Instagram
 
Ontdekmedia presentatie
Ontdekmedia presentatie Ontdekmedia presentatie
Ontdekmedia presentatie
 
Electronics bits
Electronics bitsElectronics bits
Electronics bits
 
Ett lyft för skolbiblioteket 110407 i Tammerfors
Ett lyft för skolbiblioteket 110407 i TammerforsEtt lyft för skolbiblioteket 110407 i Tammerfors
Ett lyft för skolbiblioteket 110407 i Tammerfors
 
U Clubsocialmedifinal
U ClubsocialmedifinalU Clubsocialmedifinal
U Clubsocialmedifinal
 
Fail to prepare - Softworld 2011
Fail to prepare -  Softworld 2011Fail to prepare -  Softworld 2011
Fail to prepare - Softworld 2011
 
Does the Internet harm children's health? A critical review of the evidence
Does the Internet harm children's health? A critical review of the evidenceDoes the Internet harm children's health? A critical review of the evidence
Does the Internet harm children's health? A critical review of the evidence
 
Bren Poster Presentation Workshop
Bren Poster Presentation WorkshopBren Poster Presentation Workshop
Bren Poster Presentation Workshop
 
CREATE 0708 Intro
CREATE 0708 IntroCREATE 0708 Intro
CREATE 0708 Intro
 

Similaire à 준비하세요 Angular js 2.0

How to Mess Up Your Angular UI Components
How to Mess Up Your Angular UI ComponentsHow to Mess Up Your Angular UI Components
How to Mess Up Your Angular UI Componentscagataycivici
 
Angular js 2.0, ng poznań 20.11
Angular js 2.0, ng poznań 20.11Angular js 2.0, ng poznań 20.11
Angular js 2.0, ng poznań 20.11Kamil Augustynowicz
 
Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)Eyal Vardi
 
Reactive Type-safe WebComponents
Reactive Type-safe WebComponentsReactive Type-safe WebComponents
Reactive Type-safe WebComponentsMartin Hochel
 
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점 Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점 WebFrameworks
 
Protractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applicationsProtractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applicationsLudmila Nesvitiy
 
Jquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript BasicsJquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript BasicsEPAM Systems
 
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)Ontico
 
Backbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCBackbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCpootsbook
 
angular fundamentals.pdf angular fundamentals.pdf
angular fundamentals.pdf angular fundamentals.pdfangular fundamentals.pdf angular fundamentals.pdf
angular fundamentals.pdf angular fundamentals.pdfNuttavutThongjor1
 
Hidden Docs in Angular
Hidden Docs in AngularHidden Docs in Angular
Hidden Docs in AngularYadong Xie
 
Angular2: Quick overview with 2do app example
Angular2: Quick overview with 2do app exampleAngular2: Quick overview with 2do app example
Angular2: Quick overview with 2do app exampleAlexey Frolov
 
Pengenalan AngularJS
Pengenalan AngularJSPengenalan AngularJS
Pengenalan AngularJSEdi Santoso
 
Angular JS deep dive
Angular JS deep diveAngular JS deep dive
Angular JS deep diveAxilis
 
Gutenberg sous le capot, modules réutilisables
Gutenberg sous le capot, modules réutilisablesGutenberg sous le capot, modules réutilisables
Gutenberg sous le capot, modules réutilisablesRiad Benguella
 
Single Page Applications in Angular (italiano)
Single Page Applications in Angular (italiano)Single Page Applications in Angular (italiano)
Single Page Applications in Angular (italiano)Fabio Biondi
 

Similaire à 준비하세요 Angular js 2.0 (20)

How to Mess Up Your Angular UI Components
How to Mess Up Your Angular UI ComponentsHow to Mess Up Your Angular UI Components
How to Mess Up Your Angular UI Components
 
Angular js 2.0, ng poznań 20.11
Angular js 2.0, ng poznań 20.11Angular js 2.0, ng poznań 20.11
Angular js 2.0, ng poznań 20.11
 
Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)
 
Reactive Type-safe WebComponents
Reactive Type-safe WebComponentsReactive Type-safe WebComponents
Reactive Type-safe WebComponents
 
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점 Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
 
Protractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applicationsProtractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applications
 
Clean Javascript
Clean JavascriptClean Javascript
Clean Javascript
 
Angular 2.0 - What to expect
Angular 2.0 - What to expectAngular 2.0 - What to expect
Angular 2.0 - What to expect
 
Jquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript BasicsJquery Complete Presentation along with Javascript Basics
Jquery Complete Presentation along with Javascript Basics
 
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
 
Backbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCBackbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVC
 
angular fundamentals.pdf angular fundamentals.pdf
angular fundamentals.pdf angular fundamentals.pdfangular fundamentals.pdf angular fundamentals.pdf
angular fundamentals.pdf angular fundamentals.pdf
 
Hidden Docs in Angular
Hidden Docs in AngularHidden Docs in Angular
Hidden Docs in Angular
 
Get AngularJS Started!
Get AngularJS Started!Get AngularJS Started!
Get AngularJS Started!
 
Angular2: Quick overview with 2do app example
Angular2: Quick overview with 2do app exampleAngular2: Quick overview with 2do app example
Angular2: Quick overview with 2do app example
 
Pengenalan AngularJS
Pengenalan AngularJSPengenalan AngularJS
Pengenalan AngularJS
 
Angular2 + rxjs
Angular2 + rxjsAngular2 + rxjs
Angular2 + rxjs
 
Angular JS deep dive
Angular JS deep diveAngular JS deep dive
Angular JS deep dive
 
Gutenberg sous le capot, modules réutilisables
Gutenberg sous le capot, modules réutilisablesGutenberg sous le capot, modules réutilisables
Gutenberg sous le capot, modules réutilisables
 
Single Page Applications in Angular (italiano)
Single Page Applications in Angular (italiano)Single Page Applications in Angular (italiano)
Single Page Applications in Angular (italiano)
 

Dernier

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 

Dernier (20)

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

준비하세요 Angular js 2.0

  • 4. Motivation for AngularJS 2.0 ● 성능 ● 웹의 변화 ● 쓰기 편함
  • 5. 성능 최초 AngularJS는 디자이너를 위해 만들어 졌 다.
  • 6. 웹의 변화 ES6 Web Components ● Custom Elements ● HTML Imports ● Template Element ● Shadow Dom
  • 7. 쓰기 어려움 출처 http://www.bennadel.com/blog/2439-my-experience-with-angularjs- the-super-heroic-javascript-mvw-framework.htm
  • 10. AtScript? 언어를 만드는거냐? 더 어렵게 만들려는 수작이야?
  • 11.
  • 12. module.directive('blink', ['$timeout', function($timeout) { return { require: 'options', restrict: 'A', link: function(_,element,__,options){ var selectors = someThirdPartyAPI(); element.query(selectors.join(',')) .forEach(e => options.apply(e)); } }; }]);
  • 13. module.directive('blink', ['$timeout', function($timeout) { return { require: 'options', restrict: 'A', link: function(_,element,__,options){ var selectors = someThirdPartyAPI(); element.query(selectors.join(',')) .forEach(e => options.apply(e)); } }; }]);
  • 14. module.directive('blink', ['$timeout', function($timeout) { return { require: 'options', restrict: 'A', link: function(_,element,__,options){ var selectors = someThirdPartyAPI(); element.query(selectors.join(',')) .forEach(e => options.apply(e)); } }; }]); Array<CssSelectors> Element
  • 15. @Directive({ selector: ['[blink]'] }) class Blink { constructor(element:Element, options:Options, timeout:Timeout) { var selectors:Array<CssSelectors> = someThirdPartyAPI(); element.query(selectors.join(',')) .forEach(e => options.apply(e)); } }
  • 16. Ideal Development Environment Optional Metadata Types AtScript Introspection
  • 17. ES3 '99 - try/catch - RegExp ES4 '07 - Types - Classes - Modules - (other) ES5 '09 - strict mode ES6 '15 - Classes - Modules - (other) ES? '?? - Types - Annotation - Introspection
  • 18. AtScript - Annotations - Introspection TypeScript - Types ES6 - classes - modules ES5
  • 19. ES5 function Blink(element, options, timeout) { } Blink.annotations = [ new Directive({selector: '[blink]'})]; Blink.parameters = [ Element, Options, Timeout];
  • 20. ES6 class Blink { constructor(element, options, timeout) { } } Blink.annotations = [ new Directive({selector: '[blink]'})]; Blink.parameters = [ Element, Options, Timeout];
  • 21. TypeScript class Blink { public static annotations = [ new Directive({selector: '[blink]'})]; public static parameters = [ Element, Options, Timeout]; constructor(element:Element, options:Options, timeout:Timeout) { } }
  • 22. AtScript @Directive({ selector: '[blink]' }) class Blink { constructor(element:Element, options:Options, timeout:Timeout) { } }
  • 23. CoffeeScript class Blink { @annotations = [ new Directive({selector: '[blink]'})]; @parameters = [ Element, Options, Timeout]; constructor: (element, options, timeout){ } }
  • 24. AtScript != new language AtScript = ES6 + Types + Annotations + Introspections
  • 26.
  • 27. AngularJS 1.3 <div ng-controller="SantaTodoController"> <input type="text" ng-model="newTodoTitle"> <button ng-click="addTodo()">+</button> <tab-container> <tab-pane title="Tobias"> <div ng-repeat="todo in todosOf('tobias')"> <input type="checkbox" ng-model="todo.done"> {{todo.title}} <button ng-click="deleteTodo(todo)"> X </button> </div> </tab-pane> ...
  • 28. AngularJS 2.0 <div> <input type="text" [value]="newTodoTitle"> <button (click)="addTodo()">+</buton> <tab-container> <tab-pane title="Good kids"> <div [ng-repeat|todo]="todosOf('good')"> <input type="checkbox" [checked]="todo.done"> {{todo.title}} <button (click)="deleteTodo(todo)"> X </button> </div> </tab-pane> ...
  • 29. Event binding <button (click)="doSomething()">click me</button> <div (^click)="doSomithing"> <img src="..."><span>text</span> </div> <zippy #zippy title="Greeting"> Body of the text which is shown conditionally. <a href (hover)="zippy.close()">hover to close</a>. </zippy> <button (click)="zippy.toggle()">toggle</button>
  • 30. AngularJS 2.0 <div> <input type="text" [value]="newTodoTitle"> <button (click)="addTodo()">+</buton> <tab-container> <tab-pane title="Good kids"> <div [ng-repeat|todo]="todosOf('good')"> <input type="checkbox" [checked]="todo.done"> {{todo.title}} <button (click)="deleteTodo(todo)"> X </button> </div> </tab-pane> ...
  • 31. Property binding <div [property-name]="expression"> <div [ng-repeat|person]="people"> <span [text]="person.name"></span> </div>
  • 32. AngularJS 2.0 <div> <input type="text" [value]="newTodoTitle"> <button (click)="addTodo()">+</buton> <tab-container> <tab-pane title="Good kids"> <div [ng-repeat|todo]="todosOf('good')"> <input type="checkbox" [checked]="todo.done"> {{todo.title}} <button (click)="deleteTodo(todo)"> X </button> </div> </tab-pane> ...
  • 33. AngularJS 2.0 <div> <input type="text" [value]="newTodoTitle"> <button (click)="addTodo()">+</buton> <tab-container> <tab-pane title="Good kids"> <div [ng-repeat|todo]="todosOf('good')"> <input type="checkbox" [checked]="todo.done"> {{todo.title}} <button (click)="deleteTodo(todo)"> X </button> </div> </tab-pane> ...
  • 34. Databinding Databinding to Element`s properties not to Element`s attributes <elm attr=”...”> elm.property=...
  • 37. Components = Building block (LEGO)
  • 39. Directive Definition Object ("DDO") myModule.directive('directiveName', function factory(injectables) { return { priority: 0, template: '<div></div>', // or // function(tElement, tAttrs) { ... }, // or // templateUrl: 'directive.html', // or // function(tElement, tAttrs) { ... }, transclude: false, restrict: 'A', templateNamespace: 'html', scope: false, controller: function($scope, $element, $attrs, $transclude, otherInjectables) { ... }, controllerAs: 'stringAlias', require: 'siblingDirectiveName', // or // ['^parentDirectiveName', '? optionalDirectiveName', '?^optionalParent'], compile: function compile(tElement, tAttrs, transclude) { return { pre: function preLink(scope, iElement, iAttrs, controller) { ... }, post: function postLink(scope, iElement, iAttrs, controller) { ... } } // or // return function postLink( ... ) { ... }
  • 40. Component = Directive … 그 지저분한 Directive 만 가지고 만들라고?
  • 43. SantaTodoApp component @ComponentDirective class SantaTodoApp { constructor() { this.newTodoTitle = ''; } addTodo: function() { ... } removeTodo: function(todo) { ... } todosOf: function(filter) { ... } }
  • 44. SantaTodoApp component @ComponentDirective({ ... }) class SantaTodoApp { ... } @TemplateDirective({ ... }) class NgRepeat { ... } @DecoratorDirective({ ... }) class NgClass { ... }
  • 45. SantaTodoApp component @ComponentDirective class SantaTodoApp { constructor() { this.newTodoTitle = ''; } addTodo: function() { ... } removeTodo: function(todo) { ... } todosOf: function(filter) { ... } }
  • 46. 어? $scope 은 어딨지?
  • 48. Component is the execution context for the template 컴포넌트의 모든 속성과 메소 드는 템플릿에서 사용할 수 있 다.
  • 50. Defining services class TodoStore { constructor(win:Window) { this.win = win; } add(todo) { // access this.win.localStorage ... } remove(todo) { ... } todosOf(filter) { ... } }
  • 52. Using services import {TodoStore} from './store'; @ComponentDirective({ directives: [TabContainer, TabPane, NgRepeat] }) class SantaTodoApp { constructor(store:TodoStore) { ... } ... }
  • 53. Directives and DI <tab-container> <tab-pane title="Tobias"> New Macbook Pro Tesla Model X ... </tab-pane> <tab-pane title="Good kids"> ... </tab-pane> <tab-pane title="Bad kids"> ... </tab-pane> </tab-container>
  • 54. Directives and DI class TabPane { constructor( tabContainer:TabContainer, element:HTMLElement ) { ... } ... } class TabContainer { constructor(tabs:Query<TabPane>) { ... } ... }
  • 55. 요약 사망 : Controller, $scope, DDO, Module, jqLite 출생 : AtScript, Web Component 지원, more? 다이어트를 했다?
  • 56. Angular 2.0 Source https://github.com/angular/angular
  • 57. reference Angular 2.0 Core by Igor Minar & Tobias Bosch at ng-europe 2014(Youtube) Miško Hevery - Keynote on AtScript at ng-europe 2014 (Youtube) Angular v2 Template Syntax Summary (Google Doc) Databinding with Web Components (Google Doc)