SlideShare a Scribd company logo
Angular 컴포넌트 대화법
Jeado Ko
+jeado.ko (고재도)
haibane84@gmail.com
- “Google Developer Expert” WebTech
- “Kakao Bank 빅데이터 파트” Developer
질문이 있습니다!
컴포넌트

Recommended for you

Practical AngularJS
Practical AngularJSPractical AngularJS
Practical AngularJS

Chicago Coder Conference 2015 Speaker Biography: Wei Ru Wei Ru has over 15 years of professional experience in design and development of Java enterprise applications across multiple industries. Currently he works as a technical architect at STA Group, LLC. He received a M.S. degree in Computer Science from Loyola University Chicago. As a software developer with an emphasis on Java, he strongly believes in software re-usability, open standards, and various best practices. He has successfully delivered many products using open source platforms and frameworks during his IT consultancies. Speaker Biography: Vincent Lau Vincent Lau has been Senior Architect at STA Group in Chicago for the last two years. He received a B.S. degree in Accounting and Finance from the University of Illinois at Chicago and worked on M.S. of Computer Science at DePaul University. He has over 15 years of software design, development, testing and project management experience on large enterprise distributed computing platforms. Most recently, he has worked on web based applications using Java, Spring, JavaScript, Angular.js, jQuery and web services. He previously had Senior Software Engineer and Lead positions in Royal Caribbean Cruises, Wells Fargo Bank, Cap Gemini America and Trans Union Corp. Presentation: Practical AngularJS AngularJS has been seen gaining momentum recently. Whether you want to develop a modern single-page application or to spice up only the view enabled by a traditional MVC web framework, AngularJS allows you to write cleaner, shorter code. AngularJS’ two-way data binding feature allows a declarative approach on views and controllers, and ultimately code modulization. With this strategic change and many features offered by AngularJS, learning AngularJS can be challenging. In this session, we will share some of the experiences we had in Angular UI development, we will cover: AngularJS modules and common project setup Communicating to a Restful service Commonly used Angular functions, directives UI Bootstrap, grid views and forms in AngularJS Custom Angular directives Asynchronous functions and event processing

chicago coder conference 2015spaangularjs
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

jQuery is a JavaScript library that simplifies HTML document manipulation and event handling. It allows developers to select elements, hide/show elements, and handle events with simple and concise code. jQuery animations and effects like fade, slide, and animate allow for creative transitions between states.

webwebsiteweb design and development
Modules and injector
Modules and injectorModules and injector
Modules and injector

The document discusses AngularJS modules and dependency injection. It explains that modules allow grouping of related code, and the injector resolves dependencies. It provides examples of defining modules, registering components, and the injector loading modules and resolving dependencies.

javascriptangularjs
● 명세specification
를 가진 재사용할 수 있는reusable
소프트웨어 구성요소 (위키피디아)
● 웹 애플리케이션의 기본 구성요소로 HTML 요소들을 포함
● 독립된 구성요소로 뷰와 로직으로 구성됨
● 컴포넌트들은 단방향 트리형태로 구성되고 최상위 루트 컴포넌트가 존재
Public API
사진 출처: https://v1.vuejs.org/guide/overview.html
컴포넌트 개요
Angular의 Hello World 컴포넌트
import { Component } from '@angular/core' ;
@Component({
selector: 'my-hello-world' ,
template: '<h1>{{title}}</h1>' ,
styles: ['h1 { color: red }' ]
})
export class HelloWorldComponent {
title = 'Hello World!!' ;
}
컴포넌트 계층구조간 커뮤니케이션
부모
컴포넌트
자식
컴포넌트
부모
컴포넌트
자식
컴포넌트
부모 컴포넌트
자식
컴포넌트
자식
컴포넌트
손주
컴포넌트
부모 컴포넌트
자식
컴포넌트
자식
컴포넌트
컴포넌트 계층구조간 커뮤니케이션
부모
컴포넌트
자식
컴포넌트
부모
컴포넌트
자식
컴포넌트

Recommended for you

AngularJS: an introduction
AngularJS: an introductionAngularJS: an introduction
AngularJS: an introduction

AngularJS is a JavaScript framework for building frontend web applications. It is inspired by Model-View-Controller (MVC) pattern and uses HTML templating with two-way data binding. Key features include DOM manipulation, validation, routing, and reusable components. The document provides an overview of AngularJS concepts like directives, data binding, controllers, modules, dependency injection, and built-in services. It also demonstrates how to create custom directives and use routing and resources services.

programmingangularjspolitecnico
Creating the interfaces of the future with the APIs of today
Creating the interfaces of the future with the APIs of todayCreating the interfaces of the future with the APIs of today
Creating the interfaces of the future with the APIs of today

The document discusses creating futuristic interfaces using web technologies like WebSockets, WebGL, and device APIs. It provides examples of syncing device orientation over WebSockets between clients, accessing the device camera with getUserMedia, and using head tracking with headtrackr.js to control the camera in a 3D scene rendered with three.js. Links are included for related projects on Wiimote control, head tracking examples, and touch tracking demos.

web socketsuser experiencewebgl
Vaadin Components @ Angular U
Vaadin Components @ Angular UVaadin Components @ Angular U
Vaadin Components @ Angular U

My presentation on Vaadin's high performance data grid that is available to use from any client-side framework. Examples from Angular 2.

griddatavaadin
[FEConf Korea 2017]Angular 컴포넌트 대화법
컴포넌트 커뮤니케이션 (부모 → 자식)
부모
컴포넌트
자식
컴포넌트
TodosComponent
TodoComponent
● 자식컴포넌트에서 부모가 전달할 속성에 @Input() 데코레이터를 사용
컴포넌트 커뮤니케이션 (부모 → 자식)
import {Component, Input, OnInit} from '@angular/core';
import {Todo} from '../../share/todo.model';
@Component({
selector: 'app-todo',
template: `
<input type="checkbox" [checked]="todo.done"> <label>{{ todo.text }}</label>
`,
styles: [`...`] // 생략
})
export class TodoComponent {
@Input() todo: Todo;
constructor() { }
}
● 부모 컴포넌트에서는 속성 바인딩을 통해 데이터 전달
컴포넌트 커뮤니케이션 (부모 → 자식)

<div *ngFor="let todo of todos" >
<app-todo [todo]="todo"></app-todo>
</div>
// todos.compotonent.ts
@Component({
selector: 'app-todos' ,
templateUrl: './todos.component.html' ,
styleUrls: ['./todos.component.css' ]
})
export class TodosComponent implements OnInit {
todos: Todo[];
constructor () {
this.todos = [
{ done: false, text: '운동하기' },
{ done: true, text: '공부하기'}
];
}
|

Recommended for you

AngularJS Framework
AngularJS FrameworkAngularJS Framework
AngularJS Framework

The document discusses AngularJS and provides an introduction and overview. It describes AngularJS as an open source JavaScript framework developed by Google that uses MVC architecture and data binding. It discusses key AngularJS concepts like directives, scopes, controllers and views. It also covers communicating with servers using $http and $resource, and provides an example of writing a custom directive.

barcampsaigon 2013
22 j query1
22 j query122 j query1
22 j query1

jQuery is a JavaScript library that simplifies HTML document traversal, event handling, animating, and Ajax interactions. It allows you to write less code that does more. jQuery selects DOM elements using CSS-style selectors and provides methods for traversing, manipulating, and animating elements. Some key benefits of jQuery include writing concise code, cross-browser compatibility, and a large ecosystem of plugins.

Advanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JSAdvanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JS

Session from GIDS 2014, showing tips and tricks for using AngularJS for creating production-ready JavaScript applications

javascriptangulargids
● 자식 컴포넌트에서 @Input을 Getter/Setter에 사용
컴포넌트 커뮤니케이션 (부모 → 자식)
@Component({
// 생략
})
export class TodoComponent {
private _todo: Todo;
get todo(): Todo { return this._todo; }
@Input()
set todo(v: Todo) {
this._todo = v;
v.text += " !!!";
}
constructor() {}
}
● 부모컴포넌트에서 자식 컴포넌트 인스턴스를 @ViewChild()로 가져옴
컴포넌트 커뮤니케이션 (부모 → 자식)

<div class="title">
<app-title></app-title>
<h2>{{ today | date:'M월 d일' }}</h2>
</div>

export class TodosComponent implements OnInit {
// 생략
@ViewChild(TitleComponent) titleComp :TitleComponent;
ngOnInit() {
this.titleComp.text = '나의 하루'
}
}
컴포넌트 커뮤니케이션 (자식 → 부모)
부모
컴포넌트
자식
컴포넌트
TodosComponent
AddTodoComponent
● 자식컴포넌트에서 EventEmitter를 통해 부모가 전달 받을 이벤트를 발생하는
속성에 @Output() 데코레이터를 사용
컴포넌트 커뮤니케이션 (자식 → 부모)
@Component({
selector: 'app-add-todo' ,
template: `<button (click)="btnClicked(newText)">+</button>
<input type="text" placeholder=" 할 일 추가" [(ngModel)]="newText">` ,
styles: ['...'] // 생략
})
export class AddTodoComponent {
@Output() onTodoAdded = new EventEmitter();
newText: string;
constructor () { }
btnClicked(newText: string) {
this.onTodoAdded .emit(newText);
this.newText = '';
}
}

Recommended for you

Angular js
Angular jsAngular js
Angular js

AngularJS is a JavaScript framework for building dynamic web applications. It uses MVC architecture and allows developers to write client-side code using HTML as the template language. Key features include two-way data binding, directives for extending HTML, dependency injection, and routing. AngularJS aims to solve problems with traditional HTML by making it dynamic and declarative. It separates concerns into models, views, and controllers and uses services to retrieve data from servers.

AngularJS Basics with Example
AngularJS Basics with ExampleAngularJS Basics with Example
AngularJS Basics with Example

This document provides a summary of the AngularJS framework. It discusses the following key points in 3 sentences: 1. AngularJS aims to make HTML better suited for building applications by teaching the browser new syntax like directives. This allows more of the application logic to be handled in the declarative HTML instead of JavaScript code. 2. Angular follows an MVC pattern where the controller contains the business logic and data, the view displays the data through bindings, and the scope acts as a synchronization mechanism between the model and view. 3. Features like data binding, directives, dependency injection and routing allow building dynamic and interactive single-page applications by synchronizing the model and view through declarative templates and separating concerns

frameworksgoogleweb design and development
AngularJS Internal
AngularJS InternalAngularJS Internal
AngularJS Internal

AngularJS uses a compile process to link directives and scopes. During compilation, it executes factory functions, template functions, compile functions, controllers, pre-link functions and post-link functions for each directive. This process recursively compiles child elements. The compiled output can then be linked with a scope during the linking phase to instantiate the directive.

angularjsjavascript
● 부모 컴포넌트는 $event로 이벤트의 데이터를 전달 받음
컴포넌트 커뮤니케이션 (자식 → 부모)

<div>
<app-add-todo (onTodoAdded)="addTodo($event)"></app-add-todo>
</div>

export class TodosComponent {
// 생략
addTodo(text: string) {
this.todos.push({done : false, text});
}
}
● 자식컴포넌트에서 부모컴포넌트를 주입받음
컴포넌트 커뮤니케이션 (자식 → 부모)
@Component({
selector: 'app-add-todo' ,
template: `<button (click)="btnClicked(newText)">+</button>
<input type="text" placeholder=" 할 일 추가" [(ngModel)]="newText">` ,
styles: ['...'] // 생략
})
export class AddTodoComponent {
@Output() onTodoAdded = new EventEmitter ();
newText: string;
constructor(private todosComponent: TodosComponent) { }
btnClicked(newText: string) {
// this.onTodoAdded.emit(newText);
this.todosComponent.addTodo(newText);
this.newText = '';
}
}
부모 컴포넌트
자식
컴포넌트
자식
컴포넌트
부모 컴포넌트
자식
컴포넌트
자식
컴포넌트
손주
컴포넌트
[FEConf Korea 2017]Angular 컴포넌트 대화법

Recommended for you

AngularJs
AngularJsAngularJs
AngularJs

AngularJS is a JavaScript MVC framework developed by Google in 2009. It uses HTML enhanced with directives to bind data to the view via two-way data binding. AngularJS controllers define application behavior by mapping user actions to the model. Core features include directives, filters, expressions, dependency injection and scopes that connect controllers and views. Services like $http are used to retrieve server data. AngularJS makes building single page applications easier by taking care of DOM updates automatically.

anjularjs
AngularJS Directives
AngularJS DirectivesAngularJS Directives
AngularJS Directives

This document discusses AngularJS directives and scopes. It provides examples of: - Defining directives with isolate scopes that bind to parent scope properties using '@' for interpolation, '=' for two-way binding, and '&' for function execution. - How child/isolate scopes inherit from parent scopes but can overwrite properties, while objects and arrays are shared by reference between parent and child. - Using $parent to reference properties on the parent scope from within an isolate/child scope. - The compilation process where directives are sorted and linked. So in summary, it covers the key concepts of isolate scopes, prototypal inheritance and how directives are compiled in AngularJS.

angularjsdirectives
AngularJS
AngularJSAngularJS
AngularJS

This document provides an overview of AngularJS including: - What AngularJS is and its features such as directives, filters, data binding, views, controllers and scope - How it can be used to build single page applications (SPAs) - Key directives like ng-app, ng-bind, and ng-model - How to use filters, iterate with ng-repeat, and bind data - The roles of views, controllers and scopes in AngularJS - How to create controllers within modules and use factories - How to create custom directives - The differences between values, services, factories and providers - How $watch and $watchCollection work

angularjs
AppComponent
CartComponentHomeComponent
ProductComponent ProductComponent
라우터를 연결하고 다른 모듈을 넣었다면?!

<app-drawer #drawer>
<app-cart (onClose)="drawer.close()"></fc-cart>
</app-drawer>
<app-navi></app-navi>
<main [ngClass]="{'m-t-main': !isHome}">
<router-outlet></router-outlet>
</main>
AppComponent CartComponent
HomeComponent
ProductComponent ProductComponent
RouterOutlet
App Module
Home Module
Route
{
path: 'home',
component: HomeComponent
}
서비스를 활용한 커뮤니케이션
부모 컴포넌트
자식
컴포넌트
자식
컴포넌트
서비스
부모 컴포넌트
자식
컴포넌트
자식
컴포넌트
손주
컴포넌트
서비스

Recommended for you

Workshop 27: Isomorphic web apps with ReactJS
Workshop 27: Isomorphic web apps with ReactJSWorkshop 27: Isomorphic web apps with ReactJS
Workshop 27: Isomorphic web apps with ReactJS

Workshop Isomorphic Web Apps with ReactJS: - Universal web apps - Isomorphic - Server Side Rendering (SSR) with ReactJS - Server Side Rendering with Redux - Server Side Rendering with React Router - Server Side Rendering: server.js - Main Entry Point - Server Side Rendering: server.js - HTML Template - Client main entry point: client.js - Webpack bundles - Avoiding FOUC - Webpack ExtractTextPlugin - Webpack code splitting - React Router - Configuration with Plain Routes - React Router - Dynamic Routing & WebPack - Dynamic Routing with new Reducers - Combining new Reducers - ReducerRegistry - Data fetching before rendering - React Router + Redux + Redial: Server Side - React Router + Redux + Redial: provideHooks - React Router + Redux + Redial: Client Side - SEO friendly universal web apps - React-Helmet - React-Helmet - Server Side Rendering Presentado por ingeniero: Marc Torrent

appsdeveloperdevelopers
AngularJS in 60ish Minutes
AngularJS in 60ish MinutesAngularJS in 60ish Minutes
AngularJS in 60ish Minutes

This is a talk I gave the at the AngleBrackets/DevIntersection conference in April of 2014 that covers the AngularJS JavaScript framework (one of my favorite frameworks out there!). In this talk I discussed the challenges with Single Page Applications (SPA) and how AngularJS helps solve those challenges with built-in support for two-way data binding, directives and filters, controllers and more. I also discuss the relationship of modules to controllers, factories and services, and more.

html5angularjsspa
Soscon2017 오픈소스를 활용한 마이크로 서비스의 캐시 전략
Soscon2017 오픈소스를 활용한 마이크로 서비스의 캐시 전략Soscon2017 오픈소스를 활용한 마이크로 서비스의 캐시 전략
Soscon2017 오픈소스를 활용한 마이크로 서비스의 캐시 전략

모놀리틱 아키텍처에서 마이크로 서비스로. 서비스 전환점에서 적용 가능한 캐시 전략. Cache Http API 지원으로 유연성 제공. Cache API를 구성하는 컴포넌트 설명.

redisarmerialettuce
● CartService를 통하여 카트아이템 배열CartItem[]
을 구독
CartComponent
@Component({
selector: 'app-cart',
templateUrl: './cart.component.html' ,
styleUrls: ['./cart.component.css' ]
})
export class CartComponent {
cart: CartItem[] = [];
constructor (private cartService : CartService ) {
this.cartService .cartItems
.subscribe(v => this.cart = v)
}
remove(cartItem: CartItem) {
this.cartService .remove(cartItem);
}
// 생략
}
Observable<CartItem[]>
● CartService를 통하여 카트아이템 배열CartItem[]
을 구독
HomeComponent
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.css']
})
export class HomeComponent {
constructor( private cartService: CartService) { }
addCart(product: Product) {
this.cartService.addCart(product);
}
// 생략
}
● BehaviorSubject를 이용하여 로컬스토리지의 초기 로드값이나 마지막 값을 발행
CartService (1)
@Injectable()
export class CartService {
private _items: CartItem[] = [];
private cartSubject: BehaviorSubject<CartItem[]>;
public cartItems: Observable<CartItem[]>;
constructor() {
const itemJson = localStorage.getItem(storageKey)
if (itemJson) this._items = JSON.parse(itemJson);
this.cartSubject = new BehaviorSubject(this._items);
this.cartItems = this.cartSubject.asObservable();
}
// 생략
}
CartService (2)
@Injectable()
export class CartService {
// 생략
addCart(product: Product) {
const foundProduct = this._items.find(c => c.product.id === product.id);
if (foundProduct) foundProduct.counts += 1;
else this._items.push({ product, counts: 1 });
this.updateLocalStorage(this._items);
this.cartSubject.next(this._items);
}
private updateLocalStorage(cartItems: CartItem[]) {
localStorage.setItem(storageKey, JSON.stringify(cartItems));
}
}

Recommended for you

[SOSCON 2017] 네이버의 FE 오픈소스: jindo에서 billboard.js까지
[SOSCON 2017] 네이버의 FE 오픈소스: jindo에서 billboard.js까지[SOSCON 2017] 네이버의 FE 오픈소스: jindo에서 billboard.js까지
[SOSCON 2017] 네이버의 FE 오픈소스: jindo에서 billboard.js까지

NAVER's open source, from Jindo to billboard.js 10 yrs of front-end open source development - challenges & experiences

open sourcejindobillboard.js
[NDC17] Kubernetes로 개발서버 간단히 찍어내기
[NDC17] Kubernetes로 개발서버 간단히 찍어내기[NDC17] Kubernetes로 개발서버 간단히 찍어내기
[NDC17] Kubernetes로 개발서버 간단히 찍어내기

데브시스터즈의 Cookie Run: OvenBreak 에 적용된 Kubernetes 기반 다중 개발 서버 환경 구축 시스템에 대한 발표입니다. Container orchestration 기반 개발 환경 구축 시스템의 필요성과, 왜 Kubernetes를 선택했는지, Kubernetes의 개념과 유용한 기능들을 다룹니다. 아울러 구축한 시스템에 대한 데모와, 작업했던 항목들에 대해 리뷰합니다. *NDC17 발표에서는 데모 동영상을 사용했으나, 슬라이드 캡쳐로 대신합니다.

kubernetes쿠버네티스aws
[DEVIEW 2017] 14일만에 GitHub 스타 1K 받은 차트 오픈소스 개발기
[DEVIEW 2017] 14일만에 GitHub 스타 1K 받은 차트 오픈소스 개발기[DEVIEW 2017] 14일만에 GitHub 스타 1K 받은 차트 오픈소스 개발기
[DEVIEW 2017] 14일만에 GitHub 스타 1K 받은 차트 오픈소스 개발기

차트란 무엇일까요? 차트는 우리가 일상에서 아주 쉽게 자주 접하지만, 막상 개발자로써의 경험을 하는 동안 차트 개발(적용)은 쉽게 경험해 보기 어려운 영역이기도 합니다. 본 발표는 '차트'라는 영역에 대한 개발 경험기와 함께 오픈소스로 공개 후, 단 기간 내에 많은 주목을 받기 까지의 과정을 통해 어떻게 의미있는 성과를 글로벌 하게 얻을 수 있었는가에 대한 오픈소스 성장에 대한 경험도 같이 공유합니다. 이를 통해 다양한 오픈소스 개발 시도와 참여가 활발히 이루어 지는데 도움을 줄수 있게 되기를 기대 합니다.

billboard.jschartopen source
CartService (3)
@Injectable()
export class CartService {
// 생략
remove(cartItem: CartItem) {
const foudnItem = this.cart.find(v => v.product.id === cartItem.product.id)
if (foudnItem && foudnItem.counts > 1) {
foudnItem.counts -= 1;
} else {
const index = this.cart.indexOf(foudnItem);
this.cart.splice(index, 1);
}
this.updateLocalStorage();
this.cartSubject.next(this.cart);
}
}
하지만 서비스와 컴포넌트가 아주 많아지면?
부모 컴포넌트
자식
컴포넌트
자식
컴포넌트
서비스
부모 컴포넌트
자식
컴포넌트
자식
컴포넌트
손주
컴포넌트
서비스
서비스
서비스
서비스
서비스
서비스
서비스
서비스
서비스
서비스
서비스
[FEConf Korea 2017]Angular 컴포넌트 대화법
자바스크립트 앱을 위한
예측가능한 상태
컨테이너
PREDICTABLE STATE
CONTAINER
FOR JAVASCRIPT APPS

Recommended for you

로그 기깔나게 잘 디자인하는 법
로그 기깔나게 잘 디자인하는 법로그 기깔나게 잘 디자인하는 법
로그 기깔나게 잘 디자인하는 법

흔히 만나는 실제 사례를 중심으로

business intelligencestatisticsbig data
[데이터야놀자2107] 강남 출근길에 판교/정자역에 내릴 사람 예측하기
[데이터야놀자2107] 강남 출근길에 판교/정자역에 내릴 사람 예측하기 [데이터야놀자2107] 강남 출근길에 판교/정자역에 내릴 사람 예측하기
[데이터야놀자2107] 강남 출근길에 판교/정자역에 내릴 사람 예측하기

2017 데이터야 놀자 발표 자료 최규민 탐색적 데이터 분석에 관하여 이야기 하고 있습니다.

edadata analytics탐색적데이터분석
Angular2 + rxjs
Angular2 + rxjsAngular2 + rxjs
Angular2 + rxjs

This document provides an overview of Angular 2 and Rxjs. Some key points covered include: - Angular 2 is backed by Google and designed to be faster and more memory efficient than Angular 1. It uses TypeScript and focuses on components. - Bootstrapping, modules, directives, bindings and pipes work differently in Angular 2 compared to Angular 1 with fewer overall concepts. - Observables and operators from Rxjs allow for asynchronous programming and composing asynchronous operations. Common operators like map, filter and flatMap are discussed. - Services can be used to share data between components. Components follow a lifecycle with hooks like ngOnInit and ngOnDestroy. -

angular2rxjsangularjs
WITHOUT REDUX
● 컴포넌트간 직접적인 통신
(속성 바인딩, eventEmitter 활용)
WITH REDUX
● 컴포넌트간의 직접 통신이 없다.
● 스토어를 통한 단 하나의 상태로
관리
REDUX Store
1. 컴포넌트에서 액션action
을
보냄dispatch
2. 스토어는 변화를 적용한다.
3. 컴포넌트는 관련된 상태를
전달받는다. (subscribe에 의해서)
REDUX Reducer
(state, action) => state

Recommended for you

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

This document provides an overview of Angular 2 including its history, architecture, components, services, and comparisons to React. Some key points include: - Angular 2 was announced in 2012 and released in 2016, improving on Angular 1. - It uses TypeScript for type safety and supports both declarative and imperative programming. - The core aspects of Angular 2 apps are components, which encapsulate templates, styles, and logic, and services which components use to share data.

angular2 react
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)

The document discusses how Angular components can "parasitize" the React ecosystem. It begins by providing code examples of basic Angular component creation. It then explores terminology related to parasitism and parasitoids. Various approaches for communicating between Angular components using services, properties, and Redux are presented. The document also discusses ideas for libraries that could help convert React components to Angular. It covers tools and patterns for state management in Angular like Redux and MobX. Finally, it discusses how Angular components could potentially "parasitize" the React ecosystem in both helpful and harmful ways.

рит++ 2017frontend сonf
Battle of React State Managers in frontend applications
Battle of React State Managers in frontend applicationsBattle of React State Managers in frontend applications
Battle of React State Managers in frontend applications

The complexity of frontend applications over the years led to the creation of more robust solutions, where data logic won’t be messed up at scale. A shift took place from the traditional services approach, in which data is tightly coupled to the Views of their Components, towards more composable and shareable solutions. Each of these solutions is what we call a "state-manager". Goal of this presentation is the comparative analysis between different react frontend state managers such as Redux, MobX, Recoil and React-Query. State Machines will also be presented, showing a completely different perception of how state can be orchestrated. Different mental models of the aforementioned state managers along with their different technical implementations will be presented to the audience. Ultimately, the audience can use this presentation for future reference on faster deciding which state-manager fits their own projects. Before delving into the comparison there will be a description of the main data flow in the browser. Concepts like reactivity, immutability, predictability, concurrency and performance will be detected on the main flow and will act as our comparison metrics among the state-managers.

reduxrecoilmobx
Actions
Reducers
Store
View
(Component)
subscribe
change state dispatch
angular-reduxreact-redux ngrx
● @ngrx - Reactive Extensions for Angular
ngrx (https://ngrx.github.io/)
[FEConf Korea 2017]Angular 컴포넌트 대화법

Recommended for you

React & Redux for noobs
React & Redux for noobsReact & Redux for noobs
React & Redux for noobs

Introducción a las librerías ReactJS y ReduxJS. Exploramos las APIs de cada librería y el uso de ambos módulos con sus mejores prácticas.

reactreactjsredux
Commit University - Exploring Angular 2
Commit University - Exploring Angular 2Commit University - Exploring Angular 2
Commit University - Exploring Angular 2

Probabilmente il framework javascript più atteso di sempre, evoluzione di uno dei framework più longevi ed usati nello sviluppo front end. Si vedranno alcune delle novità introdotte e delle scelte radicali fatte da Google per la nuova versione di Angular

angularjssoftwaregoogle
Angular JS2 Training Session #2
Angular JS2 Training Session #2Angular JS2 Training Session #2
Angular JS2 Training Session #2

This document provides an overview of various Angular concepts including planning an Angular app, component lifecycle, communication between components, directives, pipes, routes, services, and forms. It discusses creating a new Angular project, adding Bootstrap styles, and planning out recipe and shopping list pages. It also covers data models, component lifecycle hooks, using inputs, outputs, viewChild, local variables and services for communication. The document explains attribute directives, built-in and custom pipes, integrating routes, and when to use template-driven versus reactive forms. It wraps up by previewing topics for the next session.

angularangularj2ng2
참고 : https://gist.github.com/btroncone/a6e4347326749f938510
Setup
● npm install @ngrx/store --save후 StoreModule 모듈 임포트
import { NgModule } from '@angular/core'
import { StoreModule } from '@ngrx/store';
import { counterReducer } from './counter';
@NgModule({
imports: [
BrowserModule,
StoreModule.forRoot({ counter: counterReducer }) // ActionReducerMap 전달
]
})
export class AppModule {}
Reducer (counter.reducer.ts)
import { Action } from'@ngrx/store';
import * as CounterActions from './coutner.actions';
export function counterReducer(state: number = 0, action: CounterActions.All): number {
switch(action.type) {
case CounterActions.INCREMENT:
return state + 1;
case CounterActions.DECREMENT:
return state - 1;
case CounterActions.RESET:
return action.payload
default:
return state;
}
}
Action (counter.actions.ts)
import { Action } from '@ngrx/store';
export const INCREMENT = '[Counter] Increment';
export const DECREMENT = '[Counter] Decrement';
export const RESET = '[Counter] Reset';
export class Increment implements Action {
readonly type = INCREMENT;
}
export class Decrement implements Action {
readonly type = DECREMENT;
}
export class Reset implements Action {
readonly type = RESET;
constructor(public payload: number) {}
}
export type All = Increment | Decrement | Reset;

Recommended for you

Angular 2 - The Next Framework
Angular 2 - The Next FrameworkAngular 2 - The Next Framework
Angular 2 - The Next Framework

Angular 2 is the next version of the AngularJS framework. It was released in 2016 after 2 years of development. Some key features of Angular 2 include optimized performance for both desktop and mobile applications, ahead of time compilation for faster loading, and native support for reactive programming. The document then provides examples of core Angular concepts like components, directives, services, dependency injection and change detection. It explains how Angular 2 applications are bootstrapped and discusses some of the internal workings like the change detection engine.

googleframeworkcommit software
React render props
React render propsReact render props
React render props

Sharing code in between react components by using render props. HOC and react prop are some of the best ways to share code in react class components. #hoc #react #renderprop

react jstypescriptrender prop
React outbox
React outboxReact outbox
React outbox

React is a JavaScript library for building user interfaces and single-page applications. It allows developers to create reusable UI components called elements that can be rendered to the DOM. Components can contain state that updates the UI and respond to user events. The key concepts in React include JSX for building UI elements, components, props for passing data between components, and state for dynamic data. Setting up a React project involves installing dependencies like React, ReactDOM, and Babel to transpile JSX and enable component-based development.

reactjsprogrammingweb development
Component
export interface AppState { counter: number }
@Component({
selector: 'my-app',
template: `
<button (click)="increment()">Increment</button>
<div>Current Count: {{ counter | async }}</div>
<button (click)="decrement()">Decrement</button>
<button (click)="reset()">Reset Counter</button>
`})
export class CounterComponent {
counter: Observable<number>;
constructor (private store: Store<AppState>) {
this.counter = store.select('counter');
}
increment(){ this.store.dispatch(new Counter.Increment()); }
decrement(){ this.store.dispatch(new Counter.Decrement()); }
reset(){ this.store.dispatch(new Counter.Reset(1)); }
}
[FEConf Korea 2017]Angular 컴포넌트 대화법
DashboardComponent
TableComponentGraphComponent
AppModule
import { StoreModule } from '@ngrx/store';
import * as fromRoot from './store';
@NgModule({
imports: [
CommonModule,
StoreModule.forRoot(fromRoot.reducers, {initialState: fromRoot.getInitialState()}),
],
providers: [ // 생략 ],
declarations: []
})
export class AppModule { }

Recommended for you

angular fundamentals.pdf angular fundamentals.pdf
angular fundamentals.pdf angular fundamentals.pdfangular fundamentals.pdf angular fundamentals.pdf
angular fundamentals.pdf angular fundamentals.pdf

This document provides an overview of Angular fundamentals including components, directives, pipes, services, and reactive programming concepts. It defines components as reusable UI building blocks that control a view. It demonstrates core directives like NgFor, NgIf, and NgSwitch. It also covers lifecycle hooks, built-in and custom pipes, dependency injection with services, RxJS observables, and reactive programming concepts like streams and operators.

React hooks
React hooksReact hooks
React hooks

This document discusses React hooks and how they enhance functional components. It explains that hooks allow functional components to maintain state and lifecycle methods like class components. The key hooks discussed are useState for managing state, useEffect for side effects like data fetching, and useCallback and useMemo for optimization. Custom hooks are also covered as a way to extract reusable logic. Overall, hooks improve on class components by making code more modular, reusable and easier to test.

reactreact hooks
Enhance react app with patterns - part 1: higher order component
Enhance react app with patterns - part 1: higher order componentEnhance react app with patterns - part 1: higher order component
Enhance react app with patterns - part 1: higher order component

Writing codes without mindset is a mess. Use one of React advanced patterns to enhance your code base by Higher Order Component. Please check demo repo for more detail: https://github.com/xJkit/trendmicro-fed-talk-pattern-hoc

reactreact.jshigher order component
import * as fromSales from './sales/sales.reducer' ;
import * as fromOrder from './order/order.reducer' ;
export interface AppState {
sales: fromSales.State;
orders: fromOrder.OrderState;
}
export const initialState : AppState = {
sales: fromSales.initialState ,
orders: fromOrder.initialState
};
export function getInitialState (): AppState {
return initialState ;
}
export const reducers: ActionReducerMap <AppState> = {
sales: fromSales.reducer,
orders: fromOrder.reducer
};
store/index.ts
import { Order } from '../../models/order.model';
import * as moment from 'moment';
export interface OrderState {
orders: Order[];
selectedOrder: Order;
from: Date;
to: Date;
}
export const initialState: OrderState = {
orders: [],
selectedOrder: null,
from: moment().toDate(),
to: moment().startOf('day').toDate()
};
order/order.reducer.ts
export const SEARCH_ORDERS = '[Order] SEARCH_ORDERS';
export const SELECT_ORDER = '[Order] SELECT_ORDER';
export const RESET = '[Order] RESET';
export class SearchOrder implements Action {
readonly type = SEARCH_ORDERS;
}
export class SelectOrder implements Action {
readonly type = SELECT_ORDER;
constructor(public order: Order) {}
}
export class Reset implements Action {
readonly type = RESET;
}
export type All = ReqSearchOrders | SearchOrder | SelectOrder | Reset;
order/order.action.ts
import * as orderActions from './order.action';
export function reducer(state = initialState, action: orderActions.All): OrderState {
switch (action.type) {
case orderActions.SEARCH_ORDERS:
return Object.assign({}, state, { orders: [ /* 오더 데이터 생략… */ ]);
case orderActions.SELECT_ORDER:
return Object.assign({}, state, { selectedOrder: action.order });
case orderActions.RESET:
return Object.assign({}, state, { selectedOrder: null });
default:
return state;
}
}
order/order.reducer.ts

Recommended for you

Building an angular application -1 ( API: Golang, Database: Postgres) v1.0
Building an angular application -1 ( API: Golang, Database: Postgres) v1.0Building an angular application -1 ( API: Golang, Database: Postgres) v1.0
Building an angular application -1 ( API: Golang, Database: Postgres) v1.0

The document provides instructions for building an Angular application with a Golang API and PostgreSQL database. It includes steps to set up the Angular and API projects, configure services and routing in Angular, and build components for item purchase, display, and reporting. The Angular app uses the Golang API to perform CRUD operations on a PostgreSQL database and display the data.

angulargolangpostgresql
React redux
React reduxReact redux
React redux

React is a JavaScript library for building user interfaces that uses a virtual DOM for efficient updates. Redux is used to handle the state of React applications in a predictable way using stores, actions, and reducers. Together, React and Redux form a powerful combination where React components interact with the Redux store via containers to update the UI based on state changes.

reduxjavascriptreact
Advanced React Component Patterns - ReactNext 2018
Advanced React Component Patterns - ReactNext 2018Advanced React Component Patterns - ReactNext 2018
Advanced React Component Patterns - ReactNext 2018

This document summarizes advanced React patterns discussed by Robert Herbst in his presentation. It covers: 1. Presentational and container components, with presentational components being pure and unaware of Redux state while container components connect to Redux. 2. Other patterns like child-aware components that interrogate child components, service injection components for context, and styled components that generate styles. 3. The document argues that components should be separated into pure and side effect categories for simplicity, testability, and composability, even as Hooks make side effects easier to incorporate into components.

reactreactnext
@Component({
selector: 'app-table' ,
templateUrl: './table.component.html' ,
styleUrls: ['./table.component.scss' ]
})
export class TableComponent implements OnInit {
orders: Observable<Order[]>;
selectedOrder : Order;
constructor (private store: Store<AppState>) {
this.orders = store.select(v => v.orders.orders)
this.store.select(v => v.orders.selectedOrder )
.subscribe(v => this.selectedOrder = v);
}
select(p: Order) {
if (p === this.selectedOrder ) {
this.store.dispatch(new orderActions .Reset());
} else {
this.store.dispatch(new orderActions .SelectOrder (p));
}
}
}
TableComponent
@Component({
selector: 'app-dashboard',
templateUrl: './dashboard.component.html',
styleUrls: ['./dashboard.component.scss']
})
export class DashboardComponent implements OnInit {
constructor(private store: Store<AppState>) { }
ngOnInit() {
this.store.dispatch(new SearchOrders())
this.store.dispatch(new GetTotalSales())
}
}
DashboardComponent
코드에 박힌
데이터 말고 실제
서비스는 어떻게
하는데…
@ngrx/effects
출처: https://blog.nextzy.me/manage-action-flow-in-ngrx-with-ngrx-effects-1fda3fa06c2f

Recommended for you

React 16: new features and beyond
React 16: new features and beyondReact 16: new features and beyond
React 16: new features and beyond

The document discusses React features including fragments for flattening component hierarchy, component return types allowing arrays or strings, simplified component lifecycle with error handling, context for passing data to children without props, portals for rendering outside the root node, and improved refs with forwarding and createRef.

EWD 3 Training Course Part 39: Building a React.js application with QEWD, Part 3
EWD 3 Training Course Part 39: Building a React.js application with QEWD, Part 3EWD 3 Training Course Part 39: Building a React.js application with QEWD, Part 3
EWD 3 Training Course Part 39: Building a React.js application with QEWD, Part 3

This document discusses separating concerns in React components. It provides an example of extracting the dynamic logic from a React component into a separate controller module. This keeps the component focused only on the view logic and renders. The controller module is required by the component and handles any asynchronous behavior or state updates. Separating these concerns improves modularity and makes the code easier to understand and maintain. The example transforms an existing component to use this pattern by moving the dynamic code into a new controller file and augmenting the main component with the controller's methods.

javascriptnode.jsdatabase
Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...
Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...
Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...

A workshop to introduce Universal JavaScript with React (interactive version at http://loige.link/uni-js-workshop )

reactreact-routeruniversal
Actions
Reducers
Store
View
(Component)
subscribe
change state
dispatch
Effect
@ngrx/effects flow
Service
subscribe
dispatch
export const REQ_SEARCH_ORDERS = '[Order] REQ_SEARCH_ORDERS';
export const REQ_SEARCH_SUCCESS = '[Order] REQ_SEARCH_SUCCESS';
export const SELECT_ORDER = '[Order] SELECT_ORDER';
export const RESET = '[Order] RESET';
export class ReqSearchOrders implements Action {
readonly type = REQ_SEARCH_ORDERS;
constructor(public orderNumber?: string) {}
}
export class ReqSearchSuccess implements Action {
readonly type = REQ_SEARCH_SUCCESS;
constructor(public orders: Order[]) {}
}
// 생략
order/order.action.ts
export function reducer(state = initialState, action: orderActions.All): OrderState {
switch (action.type) {
case orderActions.REQ_SEARCH_ORDERS:
return state;
case orderActions.REQ_SEARCH_SUCCESS:
return Object.assign({}, state, { orders: action.orders });
case orderActions.SELECT_ORDER:
return Object.assign({}, state, { selectedOrder: action.order });
case orderActions.RESET:
return Object.assign({}, state, { selectedOrder: null });
default:
return state;
}
}
order/order.reducer.ts
import { Effect, Actions } from '@ngrx/effects';
import * as orderAction from './order.action';
@Injectable()
export class OrderEffects {
@Effect()
request$: Observable<Action> = this.actions$
.ofType<orderAction.ReqSearchOrders>(orderAction.REQ_SEARCH_ORDERS)
.map(v => v.orderNumber)
.mergeMap(num => {
return this.orderService.getOrders(num)
.map((orders: Order[]) => new orderAction.ReqSearchSuccess(orders))
.catch(() => Observable.of(new orderAction.ReqSearchSuccess([])));
});
constructor(private actions$: Actions, private orderService: OrderService) { }
}
order/order.effects.ts

Recommended for you

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

Gutenberg arrive, ça change tout pour ce qui est de la création de contenu dans WordPress. Mais ce que vous ne savez pas c’est que Gutenberg a le potentiel pour changer beaucoup de choses pour les développeurs de plugins et de thèmes WordPress et même à l’extérieur de la communauté WordPress. De la gestion des données de votre plugin, la gestion des dates, l’internationalisation à l’interface UI, Gutenberg est une mine d’or qui ne demande qu’à être exploitée. Explorons ensemble l’architecture modulaire de Gutenberg et apprenons à réutiliser ses modules pour ses propres projets.

gutenbergwordpress
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf

Kief Morris rethinks the infrastructure code delivery lifecycle, advocating for a shift towards composable infrastructure systems. We should shift to designing around deployable components rather than code modules, use more useful levels of abstraction, and drive design and deployment from applications rather than bottom-up, monolithic architecture and delivery.

infrastructure as codeclouddevops
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf

As a popular open-source library for analytics engineering, dbt is often used in combination with Airflow. Orchestrating and executing dbt models as DAGs ensures an additional layer of control over tasks, observability, and provides a reliable, scalable environment to run dbt models. This webinar will cover a step-by-step guide to Cosmos, an open source package from Astronomer that helps you easily run your dbt Core projects as Airflow DAGs and Task Groups, all with just a few lines of code. We’ll walk through: - Standard ways of running dbt (and when to utilize other methods) - How Cosmos can be used to run and visualize your dbt projects in Airflow - Common challenges and how to address them, including performance, dependency conflicts, and more - How running dbt projects in Airflow helps with cost optimization Webinar given on 9 July 2024

apache airflowdbtdbt-core
[FEConf Korea 2017]Angular 컴포넌트 대화법
import * as salesAction from '../sales/sales.action';
@Effect()
forward$: Observable<Action> = this.actions$
.ofType<orderAction.SelectOrder|orderAction.Reset>(orderAction.SELECT_ORDER, orderAction.RESET)
.map((a) => {
if (a instanceof orderAction.SelectOrder) {
return a.order.name;
} else {
return null;
}
})
.map(name => new salesAction.ReqGivenItemSales(name));
order/order.effects.ts
import * as salesAction from '../sales/sales.action';
@Effect()
forward$: Observable<Action> = this.actions$
.ofType<orderAction.SelectOrder|orderAction.Reset>(orderAction.SELECT_ORDER, orderAction.RESET)
.map((a) => {
if (a instanceof orderAction.SelectOrder) {
return a.order.name;
} else {
return null;
}
})
.map(name => new salesAction.ReqGivenItemSales(name));
order/order.effects.ts
// TableComponent
select(p: Order) {
if (p === this.selectedOrder) {
this.store.dispatch(new orderActions.Reset());
} else {
this.store.dispatch(new orderActions.SelectOrder(p));
}
}
}
sales/sales.effects.ts
@Injectable()
export class SalesEffects {
@Effect()
requestByItem$: Observable<Action> = this.actions$
.ofType<ReqGivenItemSales>(salesAction.REQ_GIVEN_ITEM_SALES)
.map(v => v.itemNum)
.mergeMap(itemName => {
return this.selesService.getSales(itemName)
.map((sales: Sales[]) => new salesAction.ReqGetSalesSuccess(sales))
.catch(() => Observable.of(new salesAction.ReqGetSalesSuccess([])));
});
constructor(private actions$: Actions, private selesService: SalesService) { }
}

Recommended for you

Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...

Slide of the tutorial entitled "Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Emerging Trends" held at UMAP'24: 32nd ACM Conference on User Modeling, Adaptation and Personalization (July 1, 2024 | Cagliari, Italy)

user modelinguser profilinguser model
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024

Everything that I found interesting about machines behaving intelligently during June 2024

quantumfaxmachine
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly DetectionAdvanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly Detection

Cybersecurity is a major concern in today's connected digital world. Threats to organizations are constantly evolving and have the potential to compromise sensitive information, disrupt operations, and lead to significant financial losses. Traditional cybersecurity techniques often fall short against modern attackers. Therefore, advanced techniques for cyber security analysis and anomaly detection are essential for protecting digital assets. This blog explores these cutting-edge methods, providing a comprehensive overview of their application and importance.

cybersecurityanomaly detectionadvanced techniques
Sidebar
모듈!
라우팅이
존재!
sidebar-routing.module.ts
const routes: Routes = [{
path: 'events',
component: EventListComponent
}, {
path: 'events/:num',
component: EventDetailComponent
}, {
path: '',
redirectTo: 'events'
}];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class SidebarRoutingModule { }
@ngrx/router-store
/**
* Payload of ROUTER_NAVIGATION.
*/
export declare type RouterNavigationPayload<T> = {
routerState: T;
event: RoutesRecognized;
};
/**
* An action dispatched when the router navigates.
*/
export declare type RouterNavigationAction<T = RouterStateSnapshot> = {
type: typeof ROUTER_NAVIGATION;
payload: RouterNavigationPayload<T>;
};

Recommended for you

Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces

An invited talk given by Mark Billinghurst on Research Directions for Cross Reality Interfaces. This was given on July 2nd 2024 as part of the 2024 Summer School on Cross Reality in Hagenberg, Austria (July 1st - 7th)

augmented realitycross realityvirtual reality
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter

Widya Salim and Victor Ma will outline the causal impact analysis, framework, and key learnings used to quantify the impact of reducing Twitter's network latency.

Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf

Sustainability requires ingenuity and stewardship. Did you know Pigging Solutions pigging systems help you achieve your sustainable manufacturing goals AND provide rapid return on investment. How? Our systems recover over 99% of product in transfer piping. Recovering trapped product from transfer lines that would otherwise become flush-waste, means you can increase batch yields and eliminate flush waste. From raw materials to finished product, if you can pump it, we can pig it.

pigging solutionsprocess piggingproduct transfers
EventListComponent
@Component({
selector: 'app-event-list',
templateUrl: './event-list.component.html',
styleUrls: ['./event-list.component.scss']
})
export class EventListComponent {
orderEvents: Observable<OrderEvent[]>
selectedOrderEvent: OrderEvent;
constructor(private store: Store<AppState>, private route: ActivatedRoute) {
this.orderEvents = store.select(v => v.events.orderEvents)
}
}
event-list.component.html 일부
<ul class="sidebar-list">
<li *ngFor="let event of orderEvents | async" [routerLink]="[event.orderNumber]">
<a>
<span class="label label-primary pull-right">NEW</span>
<h4>주문번호: {{event.orderNumber}}</h4>
{{event.text}}
<div class="small">수량: {{event.salesNumber}}</div>
<div class="small text-muted m-t-xs">판매시간 - {{event.date | date:'medium'}}</div>
</a>
</li>
</ul>
EventEffects��
에디터에서 보겠습니다.
감사합니다.

Recommended for you

Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation

Java Servlet programs

Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx

MuleSoft Meetup on APM and IDP

mulesoftai
Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant

Password Rotation in 2024 is still Relevant

passwordmanagementrotation
● https://css-tricks.com/learning-react-redux/
● https://github.com/ngrx/platform
● https://gist.github.com/btroncone/a6e4347326749f938510
● https://blog.nextzy.me/manage-action-flow-in-ngrx-with-ngrx-effects-1fda3fa06c2f
reference

More Related Content

What's hot

IndexedDB - Querying and Performance
IndexedDB - Querying and PerformanceIndexedDB - Querying and Performance
IndexedDB - Querying and Performance
Parashuram N
 
Sane Async Patterns
Sane Async PatternsSane Async Patterns
Sane Async Patterns
TrevorBurnham
 
The AngularJS way
The AngularJS wayThe AngularJS way
The AngularJS way
Boyan Mihaylov
 
Practical AngularJS
Practical AngularJSPractical AngularJS
Practical AngularJS
Wei Ru
 
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
EPAM Systems
 
Modules and injector
Modules and injectorModules and injector
Modules and injector
Eyal Vardi
 
AngularJS: an introduction
AngularJS: an introductionAngularJS: an introduction
AngularJS: an introduction
Luigi De Russis
 
Creating the interfaces of the future with the APIs of today
Creating the interfaces of the future with the APIs of todayCreating the interfaces of the future with the APIs of today
Creating the interfaces of the future with the APIs of today
gerbille
 
Vaadin Components @ Angular U
Vaadin Components @ Angular UVaadin Components @ Angular U
Vaadin Components @ Angular U
Joonas Lehtinen
 
AngularJS Framework
AngularJS FrameworkAngularJS Framework
AngularJS Framework
Barcamp Saigon
 
22 j query1
22 j query122 j query1
22 j query1
Fajar Baskoro
 
Advanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JSAdvanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JS
Simon Guest
 
Angular js
Angular jsAngular js
Angular js
Manav Prasad
 
AngularJS Basics with Example
AngularJS Basics with ExampleAngularJS Basics with Example
AngularJS Basics with Example
Sergey Bolshchikov
 
AngularJS Internal
AngularJS InternalAngularJS Internal
AngularJS Internal
Eyal Vardi
 
AngularJs
AngularJsAngularJs
AngularJs
syam kumar kk
 
AngularJS Directives
AngularJS DirectivesAngularJS Directives
AngularJS Directives
Eyal Vardi
 
AngularJS
AngularJSAngularJS
AngularJS
LearningTech
 
Workshop 27: Isomorphic web apps with ReactJS
Workshop 27: Isomorphic web apps with ReactJSWorkshop 27: Isomorphic web apps with ReactJS
Workshop 27: Isomorphic web apps with ReactJS
Visual Engineering
 
AngularJS in 60ish Minutes
AngularJS in 60ish MinutesAngularJS in 60ish Minutes
AngularJS in 60ish Minutes
Dan Wahlin
 

What's hot (20)

IndexedDB - Querying and Performance
IndexedDB - Querying and PerformanceIndexedDB - Querying and Performance
IndexedDB - Querying and Performance
 
Sane Async Patterns
Sane Async PatternsSane Async Patterns
Sane Async Patterns
 
The AngularJS way
The AngularJS wayThe AngularJS way
The AngularJS way
 
Practical AngularJS
Practical AngularJSPractical AngularJS
Practical AngularJS
 
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
 
Modules and injector
Modules and injectorModules and injector
Modules and injector
 
AngularJS: an introduction
AngularJS: an introductionAngularJS: an introduction
AngularJS: an introduction
 
Creating the interfaces of the future with the APIs of today
Creating the interfaces of the future with the APIs of todayCreating the interfaces of the future with the APIs of today
Creating the interfaces of the future with the APIs of today
 
Vaadin Components @ Angular U
Vaadin Components @ Angular UVaadin Components @ Angular U
Vaadin Components @ Angular U
 
AngularJS Framework
AngularJS FrameworkAngularJS Framework
AngularJS Framework
 
22 j query1
22 j query122 j query1
22 j query1
 
Advanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JSAdvanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JS
 
Angular js
Angular jsAngular js
Angular js
 
AngularJS Basics with Example
AngularJS Basics with ExampleAngularJS Basics with Example
AngularJS Basics with Example
 
AngularJS Internal
AngularJS InternalAngularJS Internal
AngularJS Internal
 
AngularJs
AngularJsAngularJs
AngularJs
 
AngularJS Directives
AngularJS DirectivesAngularJS Directives
AngularJS Directives
 
AngularJS
AngularJSAngularJS
AngularJS
 
Workshop 27: Isomorphic web apps with ReactJS
Workshop 27: Isomorphic web apps with ReactJSWorkshop 27: Isomorphic web apps with ReactJS
Workshop 27: Isomorphic web apps with ReactJS
 
AngularJS in 60ish Minutes
AngularJS in 60ish MinutesAngularJS in 60ish Minutes
AngularJS in 60ish Minutes
 

Viewers also liked

Soscon2017 오픈소스를 활용한 마이크로 서비스의 캐시 전략
Soscon2017 오픈소스를 활용한 마이크로 서비스의 캐시 전략Soscon2017 오픈소스를 활용한 마이크로 서비스의 캐시 전략
Soscon2017 오픈소스를 활용한 마이크로 서비스의 캐시 전략
Kris Jeong
 
[SOSCON 2017] 네이버의 FE 오픈소스: jindo에서 billboard.js까지
[SOSCON 2017] 네이버의 FE 오픈소스: jindo에서 billboard.js까지[SOSCON 2017] 네이버의 FE 오픈소스: jindo에서 billboard.js까지
[SOSCON 2017] 네이버의 FE 오픈소스: jindo에서 billboard.js까지
Jae Sung Park
 
[NDC17] Kubernetes로 개발서버 간단히 찍어내기
[NDC17] Kubernetes로 개발서버 간단히 찍어내기[NDC17] Kubernetes로 개발서버 간단히 찍어내기
[NDC17] Kubernetes로 개발서버 간단히 찍어내기
SeungYong Oh
 
[DEVIEW 2017] 14일만에 GitHub 스타 1K 받은 차트 오픈소스 개발기
[DEVIEW 2017] 14일만에 GitHub 스타 1K 받은 차트 오픈소스 개발기[DEVIEW 2017] 14일만에 GitHub 스타 1K 받은 차트 오픈소스 개발기
[DEVIEW 2017] 14일만에 GitHub 스타 1K 받은 차트 오픈소스 개발기
Jae Sung Park
 
로그 기깔나게 잘 디자인하는 법
로그 기깔나게 잘 디자인하는 법로그 기깔나게 잘 디자인하는 법
로그 기깔나게 잘 디자인하는 법
Jeongsang Baek
 
[데이터야놀자2107] 강남 출근길에 판교/정자역에 내릴 사람 예측하기
[데이터야놀자2107] 강남 출근길에 판교/정자역에 내릴 사람 예측하기 [데이터야놀자2107] 강남 출근길에 판교/정자역에 내릴 사람 예측하기
[데이터야놀자2107] 강남 출근길에 판교/정자역에 내릴 사람 예측하기
choi kyumin
 

Viewers also liked (6)

Soscon2017 오픈소스를 활용한 마이크로 서비스의 캐시 전략
Soscon2017 오픈소스를 활용한 마이크로 서비스의 캐시 전략Soscon2017 오픈소스를 활용한 마이크로 서비스의 캐시 전략
Soscon2017 오픈소스를 활용한 마이크로 서비스의 캐시 전략
 
[SOSCON 2017] 네이버의 FE 오픈소스: jindo에서 billboard.js까지
[SOSCON 2017] 네이버의 FE 오픈소스: jindo에서 billboard.js까지[SOSCON 2017] 네이버의 FE 오픈소스: jindo에서 billboard.js까지
[SOSCON 2017] 네이버의 FE 오픈소스: jindo에서 billboard.js까지
 
[NDC17] Kubernetes로 개발서버 간단히 찍어내기
[NDC17] Kubernetes로 개발서버 간단히 찍어내기[NDC17] Kubernetes로 개발서버 간단히 찍어내기
[NDC17] Kubernetes로 개발서버 간단히 찍어내기
 
[DEVIEW 2017] 14일만에 GitHub 스타 1K 받은 차트 오픈소스 개발기
[DEVIEW 2017] 14일만에 GitHub 스타 1K 받은 차트 오픈소스 개발기[DEVIEW 2017] 14일만에 GitHub 스타 1K 받은 차트 오픈소스 개발기
[DEVIEW 2017] 14일만에 GitHub 스타 1K 받은 차트 오픈소스 개발기
 
로그 기깔나게 잘 디자인하는 법
로그 기깔나게 잘 디자인하는 법로그 기깔나게 잘 디자인하는 법
로그 기깔나게 잘 디자인하는 법
 
[데이터야놀자2107] 강남 출근길에 판교/정자역에 내릴 사람 예측하기
[데이터야놀자2107] 강남 출근길에 판교/정자역에 내릴 사람 예측하기 [데이터야놀자2107] 강남 출근길에 판교/정자역에 내릴 사람 예측하기
[데이터야놀자2107] 강남 출근길에 판교/정자역에 내릴 사람 예측하기
 

Similar to [FEConf Korea 2017]Angular 컴포넌트 대화법

Angular2 + rxjs
Angular2 + rxjsAngular2 + rxjs
Angular2 + rxjs
Christoffer Noring
 
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
Alexey Frolov
 
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Ontico
 
Battle of React State Managers in frontend applications
Battle of React State Managers in frontend applicationsBattle of React State Managers in frontend applications
Battle of React State Managers in frontend applications
Evangelia Mitsopoulou
 
React & Redux for noobs
React & Redux for noobsReact & Redux for noobs
React & Redux for noobs
[T]echdencias
 
Commit University - Exploring Angular 2
Commit University - Exploring Angular 2Commit University - Exploring Angular 2
Commit University - Exploring Angular 2
Commit University
 
Angular JS2 Training Session #2
Angular JS2 Training Session #2Angular JS2 Training Session #2
Angular JS2 Training Session #2
Paras Mendiratta
 
Angular 2 - The Next Framework
Angular 2 - The Next FrameworkAngular 2 - The Next Framework
Angular 2 - The Next Framework
Commit University
 
React render props
React render propsReact render props
React render props
Saikat Samanta
 
React outbox
React outboxReact outbox
React outbox
Angela Lehru
 
angular fundamentals.pdf angular fundamentals.pdf
angular fundamentals.pdf angular fundamentals.pdfangular fundamentals.pdf angular fundamentals.pdf
angular fundamentals.pdf angular fundamentals.pdf
NuttavutThongjor1
 
React hooks
React hooksReact hooks
React hooks
Assaf Gannon
 
Enhance react app with patterns - part 1: higher order component
Enhance react app with patterns - part 1: higher order componentEnhance react app with patterns - part 1: higher order component
Enhance react app with patterns - part 1: higher order component
Yao Nien Chung
 
Building an angular application -1 ( API: Golang, Database: Postgres) v1.0
Building an angular application -1 ( API: Golang, Database: Postgres) v1.0Building an angular application -1 ( API: Golang, Database: Postgres) v1.0
Building an angular application -1 ( API: Golang, Database: Postgres) v1.0
Frost
 
React redux
React reduxReact redux
React redux
Michel Perez
 
Advanced React Component Patterns - ReactNext 2018
Advanced React Component Patterns - ReactNext 2018Advanced React Component Patterns - ReactNext 2018
Advanced React Component Patterns - ReactNext 2018
Robert Herbst
 
React 16: new features and beyond
React 16: new features and beyondReact 16: new features and beyond
React 16: new features and beyond
Artjoker
 
EWD 3 Training Course Part 39: Building a React.js application with QEWD, Part 3
EWD 3 Training Course Part 39: Building a React.js application with QEWD, Part 3EWD 3 Training Course Part 39: Building a React.js application with QEWD, Part 3
EWD 3 Training Course Part 39: Building a React.js application with QEWD, Part 3
Rob Tweed
 
Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...
Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...
Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...
Luciano Mammino
 
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
Riad Benguella
 

Similar to [FEConf Korea 2017]Angular 컴포넌트 대화법 (20)

Angular2 + rxjs
Angular2 + rxjsAngular2 + rxjs
Angular2 + rxjs
 
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
 
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
 
Battle of React State Managers in frontend applications
Battle of React State Managers in frontend applicationsBattle of React State Managers in frontend applications
Battle of React State Managers in frontend applications
 
React & Redux for noobs
React & Redux for noobsReact & Redux for noobs
React & Redux for noobs
 
Commit University - Exploring Angular 2
Commit University - Exploring Angular 2Commit University - Exploring Angular 2
Commit University - Exploring Angular 2
 
Angular JS2 Training Session #2
Angular JS2 Training Session #2Angular JS2 Training Session #2
Angular JS2 Training Session #2
 
Angular 2 - The Next Framework
Angular 2 - The Next FrameworkAngular 2 - The Next Framework
Angular 2 - The Next Framework
 
React render props
React render propsReact render props
React render props
 
React outbox
React outboxReact outbox
React outbox
 
angular fundamentals.pdf angular fundamentals.pdf
angular fundamentals.pdf angular fundamentals.pdfangular fundamentals.pdf angular fundamentals.pdf
angular fundamentals.pdf angular fundamentals.pdf
 
React hooks
React hooksReact hooks
React hooks
 
Enhance react app with patterns - part 1: higher order component
Enhance react app with patterns - part 1: higher order componentEnhance react app with patterns - part 1: higher order component
Enhance react app with patterns - part 1: higher order component
 
Building an angular application -1 ( API: Golang, Database: Postgres) v1.0
Building an angular application -1 ( API: Golang, Database: Postgres) v1.0Building an angular application -1 ( API: Golang, Database: Postgres) v1.0
Building an angular application -1 ( API: Golang, Database: Postgres) v1.0
 
React redux
React reduxReact redux
React redux
 
Advanced React Component Patterns - ReactNext 2018
Advanced React Component Patterns - ReactNext 2018Advanced React Component Patterns - ReactNext 2018
Advanced React Component Patterns - ReactNext 2018
 
React 16: new features and beyond
React 16: new features and beyondReact 16: new features and beyond
React 16: new features and beyond
 
EWD 3 Training Course Part 39: Building a React.js application with QEWD, Part 3
EWD 3 Training Course Part 39: Building a React.js application with QEWD, Part 3EWD 3 Training Course Part 39: Building a React.js application with QEWD, Part 3
EWD 3 Training Course Part 39: Building a React.js application with QEWD, Part 3
 
Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...
Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...
Universal JS Web Applications with React - Web Summer Camp 2017, Rovinj (Work...
 
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
 

Recently uploaded

[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
Kief Morris
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
Tatiana Al-Chueyr
 
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Erasmo Purificato
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
Matthew Sinclair
 
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly DetectionAdvanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Bert Blevins
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
Mark Billinghurst
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
ScyllaDB
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
shanthidl1
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
ishalveerrandhawa1
 
Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant
Bert Blevins
 
How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx
SynapseIndia
 
How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
HackersList
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
Safe Software
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
Stephanie Beckett
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
welrejdoall
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
Vijayananda Mohire
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
BookNet Canada
 
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence
rajancomputerfbd
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
BookNet Canada
 

Recently uploaded (20)

[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
 
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
 
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly DetectionAdvanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
 
Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant
 
How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx
 
How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
 
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
 

[FEConf Korea 2017]Angular 컴포넌트 대화법

  • 2. +jeado.ko (고재도) haibane84@gmail.com - “Google Developer Expert” WebTech - “Kakao Bank 빅데이터 파트” Developer
  • 5. ● 명세specification 를 가진 재사용할 수 있는reusable 소프트웨어 구성요소 (위키피디아) ● 웹 애플리케이션의 기본 구성요소로 HTML 요소들을 포함 ● 독립된 구성요소로 뷰와 로직으로 구성됨 ● 컴포넌트들은 단방향 트리형태로 구성되고 최상위 루트 컴포넌트가 존재 Public API 사진 출처: https://v1.vuejs.org/guide/overview.html 컴포넌트 개요
  • 6. Angular의 Hello World 컴포넌트 import { Component } from '@angular/core' ; @Component({ selector: 'my-hello-world' , template: '<h1>{{title}}</h1>' , styles: ['h1 { color: red }' ] }) export class HelloWorldComponent { title = 'Hello World!!' ; }
  • 7. 컴포넌트 계층구조간 커뮤니케이션 부모 컴포넌트 자식 컴포넌트 부모 컴포넌트 자식 컴포넌트 부모 컴포넌트 자식 컴포넌트 자식 컴포넌트 손주 컴포넌트 부모 컴포넌트 자식 컴포넌트 자식 컴포넌트
  • 10. 컴포넌트 커뮤니케이션 (부모 → 자식) 부모 컴포넌트 자식 컴포넌트 TodosComponent TodoComponent
  • 11. ● 자식컴포넌트에서 부모가 전달할 속성에 @Input() 데코레이터를 사용 컴포넌트 커뮤니케이션 (부모 → 자식) import {Component, Input, OnInit} from '@angular/core'; import {Todo} from '../../share/todo.model'; @Component({ selector: 'app-todo', template: ` <input type="checkbox" [checked]="todo.done"> <label>{{ todo.text }}</label> `, styles: [`...`] // 생략 }) export class TodoComponent { @Input() todo: Todo; constructor() { } }
  • 12. ● 부모 컴포넌트에서는 속성 바인딩을 통해 데이터 전달 컴포넌트 커뮤니케이션 (부모 → 자식) <!-- todos.component.html 일부 --> <div *ngFor="let todo of todos" > <app-todo [todo]="todo"></app-todo> </div> // todos.compotonent.ts @Component({ selector: 'app-todos' , templateUrl: './todos.component.html' , styleUrls: ['./todos.component.css' ] }) export class TodosComponent implements OnInit { todos: Todo[]; constructor () { this.todos = [ { done: false, text: '운동하기' }, { done: true, text: '공부하기'} ]; } |
  • 13. ● 자식 컴포넌트에서 @Input을 Getter/Setter에 사용 컴포넌트 커뮤니케이션 (부모 → 자식) @Component({ // 생략 }) export class TodoComponent { private _todo: Todo; get todo(): Todo { return this._todo; } @Input() set todo(v: Todo) { this._todo = v; v.text += " !!!"; } constructor() {} }
  • 14. ● 부모컴포넌트에서 자식 컴포넌트 인스턴스를 @ViewChild()로 가져옴 컴포넌트 커뮤니케이션 (부모 → 자식) <!-- todos.component.html 일부 --> <div class="title"> <app-title></app-title> <h2>{{ today | date:'M월 d일' }}</h2> </div> <!-- todos.component.ts 일부 --> export class TodosComponent implements OnInit { // 생략 @ViewChild(TitleComponent) titleComp :TitleComponent; ngOnInit() { this.titleComp.text = '나의 하루' } }
  • 15. 컴포넌트 커뮤니케이션 (자식 → 부모) 부모 컴포넌트 자식 컴포넌트 TodosComponent AddTodoComponent
  • 16. ● 자식컴포넌트에서 EventEmitter를 통해 부모가 전달 받을 이벤트를 발생하는 속성에 @Output() 데코레이터를 사용 컴포넌트 커뮤니케이션 (자식 → 부모) @Component({ selector: 'app-add-todo' , template: `<button (click)="btnClicked(newText)">+</button> <input type="text" placeholder=" 할 일 추가" [(ngModel)]="newText">` , styles: ['...'] // 생략 }) export class AddTodoComponent { @Output() onTodoAdded = new EventEmitter(); newText: string; constructor () { } btnClicked(newText: string) { this.onTodoAdded .emit(newText); this.newText = ''; } }
  • 17. ● 부모 컴포넌트는 $event로 이벤트의 데이터를 전달 받음 컴포넌트 커뮤니케이션 (자식 → 부모) <!-- todos.component.html 일부 --> <div> <app-add-todo (onTodoAdded)="addTodo($event)"></app-add-todo> </div> <!-- todos.component.ts 일부 --> export class TodosComponent { // 생략 addTodo(text: string) { this.todos.push({done : false, text}); } }
  • 18. ● 자식컴포넌트에서 부모컴포넌트를 주입받음 컴포넌트 커뮤니케이션 (자식 → 부모) @Component({ selector: 'app-add-todo' , template: `<button (click)="btnClicked(newText)">+</button> <input type="text" placeholder=" 할 일 추가" [(ngModel)]="newText">` , styles: ['...'] // 생략 }) export class AddTodoComponent { @Output() onTodoAdded = new EventEmitter (); newText: string; constructor(private todosComponent: TodosComponent) { } btnClicked(newText: string) { // this.onTodoAdded.emit(newText); this.todosComponent.addTodo(newText); this.newText = ''; } }
  • 22. 라우터를 연결하고 다른 모듈을 넣었다면?! <!-- app.component.html --> <app-drawer #drawer> <app-cart (onClose)="drawer.close()"></fc-cart> </app-drawer> <app-navi></app-navi> <main [ngClass]="{'m-t-main': !isHome}"> <router-outlet></router-outlet> </main>
  • 23. AppComponent CartComponent HomeComponent ProductComponent ProductComponent RouterOutlet App Module Home Module Route { path: 'home', component: HomeComponent }
  • 24. 서비스를 활용한 커뮤니케이션 부모 컴포넌트 자식 컴포넌트 자식 컴포넌트 서비스 부모 컴포넌트 자식 컴포넌트 자식 컴포넌트 손주 컴포넌트 서비스
  • 25. ● CartService를 통하여 카트아이템 배열CartItem[] 을 구독 CartComponent @Component({ selector: 'app-cart', templateUrl: './cart.component.html' , styleUrls: ['./cart.component.css' ] }) export class CartComponent { cart: CartItem[] = []; constructor (private cartService : CartService ) { this.cartService .cartItems .subscribe(v => this.cart = v) } remove(cartItem: CartItem) { this.cartService .remove(cartItem); } // 생략 } Observable<CartItem[]>
  • 26. ● CartService를 통하여 카트아이템 배열CartItem[] 을 구독 HomeComponent @Component({ selector: 'app-home', templateUrl: './home.component.html', styleUrls: ['./home.component.css'] }) export class HomeComponent { constructor( private cartService: CartService) { } addCart(product: Product) { this.cartService.addCart(product); } // 생략 }
  • 27. ● BehaviorSubject를 이용하여 로컬스토리지의 초기 로드값이나 마지막 값을 발행 CartService (1) @Injectable() export class CartService { private _items: CartItem[] = []; private cartSubject: BehaviorSubject<CartItem[]>; public cartItems: Observable<CartItem[]>; constructor() { const itemJson = localStorage.getItem(storageKey) if (itemJson) this._items = JSON.parse(itemJson); this.cartSubject = new BehaviorSubject(this._items); this.cartItems = this.cartSubject.asObservable(); } // 생략 }
  • 28. CartService (2) @Injectable() export class CartService { // 생략 addCart(product: Product) { const foundProduct = this._items.find(c => c.product.id === product.id); if (foundProduct) foundProduct.counts += 1; else this._items.push({ product, counts: 1 }); this.updateLocalStorage(this._items); this.cartSubject.next(this._items); } private updateLocalStorage(cartItems: CartItem[]) { localStorage.setItem(storageKey, JSON.stringify(cartItems)); } }
  • 29. CartService (3) @Injectable() export class CartService { // 생략 remove(cartItem: CartItem) { const foudnItem = this.cart.find(v => v.product.id === cartItem.product.id) if (foudnItem && foudnItem.counts > 1) { foudnItem.counts -= 1; } else { const index = this.cart.indexOf(foudnItem); this.cart.splice(index, 1); } this.updateLocalStorage(); this.cartSubject.next(this.cart); } }
  • 30. 하지만 서비스와 컴포넌트가 아주 많아지면? 부모 컴포넌트 자식 컴포넌트 자식 컴포넌트 서비스 부모 컴포넌트 자식 컴포넌트 자식 컴포넌트 손주 컴포넌트 서비스 서비스 서비스 서비스 서비스 서비스 서비스 서비스 서비스 서비스 서비스
  • 32. 자바스크립트 앱을 위한 예측가능한 상태 컨테이너 PREDICTABLE STATE CONTAINER FOR JAVASCRIPT APPS
  • 33. WITHOUT REDUX ● 컴포넌트간 직접적인 통신 (속성 바인딩, eventEmitter 활용)
  • 34. WITH REDUX ● 컴포넌트간의 직접 통신이 없다. ● 스토어를 통한 단 하나의 상태로 관리
  • 35. REDUX Store 1. 컴포넌트에서 액션action 을 보냄dispatch 2. 스토어는 변화를 적용한다. 3. 컴포넌트는 관련된 상태를 전달받는다. (subscribe에 의해서)
  • 39. ● @ngrx - Reactive Extensions for Angular ngrx (https://ngrx.github.io/)
  • 42. Setup ● npm install @ngrx/store --save후 StoreModule 모듈 임포트 import { NgModule } from '@angular/core' import { StoreModule } from '@ngrx/store'; import { counterReducer } from './counter'; @NgModule({ imports: [ BrowserModule, StoreModule.forRoot({ counter: counterReducer }) // ActionReducerMap 전달 ] }) export class AppModule {}
  • 43. Reducer (counter.reducer.ts) import { Action } from'@ngrx/store'; import * as CounterActions from './coutner.actions'; export function counterReducer(state: number = 0, action: CounterActions.All): number { switch(action.type) { case CounterActions.INCREMENT: return state + 1; case CounterActions.DECREMENT: return state - 1; case CounterActions.RESET: return action.payload default: return state; } }
  • 44. Action (counter.actions.ts) import { Action } from '@ngrx/store'; export const INCREMENT = '[Counter] Increment'; export const DECREMENT = '[Counter] Decrement'; export const RESET = '[Counter] Reset'; export class Increment implements Action { readonly type = INCREMENT; } export class Decrement implements Action { readonly type = DECREMENT; } export class Reset implements Action { readonly type = RESET; constructor(public payload: number) {} } export type All = Increment | Decrement | Reset;
  • 45. Component export interface AppState { counter: number } @Component({ selector: 'my-app', template: ` <button (click)="increment()">Increment</button> <div>Current Count: {{ counter | async }}</div> <button (click)="decrement()">Decrement</button> <button (click)="reset()">Reset Counter</button> `}) export class CounterComponent { counter: Observable<number>; constructor (private store: Store<AppState>) { this.counter = store.select('counter'); } increment(){ this.store.dispatch(new Counter.Increment()); } decrement(){ this.store.dispatch(new Counter.Decrement()); } reset(){ this.store.dispatch(new Counter.Reset(1)); } }
  • 48. AppModule import { StoreModule } from '@ngrx/store'; import * as fromRoot from './store'; @NgModule({ imports: [ CommonModule, StoreModule.forRoot(fromRoot.reducers, {initialState: fromRoot.getInitialState()}), ], providers: [ // 생략 ], declarations: [] }) export class AppModule { }
  • 49. import * as fromSales from './sales/sales.reducer' ; import * as fromOrder from './order/order.reducer' ; export interface AppState { sales: fromSales.State; orders: fromOrder.OrderState; } export const initialState : AppState = { sales: fromSales.initialState , orders: fromOrder.initialState }; export function getInitialState (): AppState { return initialState ; } export const reducers: ActionReducerMap <AppState> = { sales: fromSales.reducer, orders: fromOrder.reducer }; store/index.ts
  • 50. import { Order } from '../../models/order.model'; import * as moment from 'moment'; export interface OrderState { orders: Order[]; selectedOrder: Order; from: Date; to: Date; } export const initialState: OrderState = { orders: [], selectedOrder: null, from: moment().toDate(), to: moment().startOf('day').toDate() }; order/order.reducer.ts
  • 51. export const SEARCH_ORDERS = '[Order] SEARCH_ORDERS'; export const SELECT_ORDER = '[Order] SELECT_ORDER'; export const RESET = '[Order] RESET'; export class SearchOrder implements Action { readonly type = SEARCH_ORDERS; } export class SelectOrder implements Action { readonly type = SELECT_ORDER; constructor(public order: Order) {} } export class Reset implements Action { readonly type = RESET; } export type All = ReqSearchOrders | SearchOrder | SelectOrder | Reset; order/order.action.ts
  • 52. import * as orderActions from './order.action'; export function reducer(state = initialState, action: orderActions.All): OrderState { switch (action.type) { case orderActions.SEARCH_ORDERS: return Object.assign({}, state, { orders: [ /* 오더 데이터 생략… */ ]); case orderActions.SELECT_ORDER: return Object.assign({}, state, { selectedOrder: action.order }); case orderActions.RESET: return Object.assign({}, state, { selectedOrder: null }); default: return state; } } order/order.reducer.ts
  • 53. @Component({ selector: 'app-table' , templateUrl: './table.component.html' , styleUrls: ['./table.component.scss' ] }) export class TableComponent implements OnInit { orders: Observable<Order[]>; selectedOrder : Order; constructor (private store: Store<AppState>) { this.orders = store.select(v => v.orders.orders) this.store.select(v => v.orders.selectedOrder ) .subscribe(v => this.selectedOrder = v); } select(p: Order) { if (p === this.selectedOrder ) { this.store.dispatch(new orderActions .Reset()); } else { this.store.dispatch(new orderActions .SelectOrder (p)); } } } TableComponent
  • 54. @Component({ selector: 'app-dashboard', templateUrl: './dashboard.component.html', styleUrls: ['./dashboard.component.scss'] }) export class DashboardComponent implements OnInit { constructor(private store: Store<AppState>) { } ngOnInit() { this.store.dispatch(new SearchOrders()) this.store.dispatch(new GetTotalSales()) } } DashboardComponent
  • 55. 코드에 박힌 데이터 말고 실제 서비스는 어떻게 하는데…
  • 58. export const REQ_SEARCH_ORDERS = '[Order] REQ_SEARCH_ORDERS'; export const REQ_SEARCH_SUCCESS = '[Order] REQ_SEARCH_SUCCESS'; export const SELECT_ORDER = '[Order] SELECT_ORDER'; export const RESET = '[Order] RESET'; export class ReqSearchOrders implements Action { readonly type = REQ_SEARCH_ORDERS; constructor(public orderNumber?: string) {} } export class ReqSearchSuccess implements Action { readonly type = REQ_SEARCH_SUCCESS; constructor(public orders: Order[]) {} } // 생략 order/order.action.ts
  • 59. export function reducer(state = initialState, action: orderActions.All): OrderState { switch (action.type) { case orderActions.REQ_SEARCH_ORDERS: return state; case orderActions.REQ_SEARCH_SUCCESS: return Object.assign({}, state, { orders: action.orders }); case orderActions.SELECT_ORDER: return Object.assign({}, state, { selectedOrder: action.order }); case orderActions.RESET: return Object.assign({}, state, { selectedOrder: null }); default: return state; } } order/order.reducer.ts
  • 60. import { Effect, Actions } from '@ngrx/effects'; import * as orderAction from './order.action'; @Injectable() export class OrderEffects { @Effect() request$: Observable<Action> = this.actions$ .ofType<orderAction.ReqSearchOrders>(orderAction.REQ_SEARCH_ORDERS) .map(v => v.orderNumber) .mergeMap(num => { return this.orderService.getOrders(num) .map((orders: Order[]) => new orderAction.ReqSearchSuccess(orders)) .catch(() => Observable.of(new orderAction.ReqSearchSuccess([]))); }); constructor(private actions$: Actions, private orderService: OrderService) { } } order/order.effects.ts
  • 62. import * as salesAction from '../sales/sales.action'; @Effect() forward$: Observable<Action> = this.actions$ .ofType<orderAction.SelectOrder|orderAction.Reset>(orderAction.SELECT_ORDER, orderAction.RESET) .map((a) => { if (a instanceof orderAction.SelectOrder) { return a.order.name; } else { return null; } }) .map(name => new salesAction.ReqGivenItemSales(name)); order/order.effects.ts
  • 63. import * as salesAction from '../sales/sales.action'; @Effect() forward$: Observable<Action> = this.actions$ .ofType<orderAction.SelectOrder|orderAction.Reset>(orderAction.SELECT_ORDER, orderAction.RESET) .map((a) => { if (a instanceof orderAction.SelectOrder) { return a.order.name; } else { return null; } }) .map(name => new salesAction.ReqGivenItemSales(name)); order/order.effects.ts // TableComponent select(p: Order) { if (p === this.selectedOrder) { this.store.dispatch(new orderActions.Reset()); } else { this.store.dispatch(new orderActions.SelectOrder(p)); } } }
  • 64. sales/sales.effects.ts @Injectable() export class SalesEffects { @Effect() requestByItem$: Observable<Action> = this.actions$ .ofType<ReqGivenItemSales>(salesAction.REQ_GIVEN_ITEM_SALES) .map(v => v.itemNum) .mergeMap(itemName => { return this.selesService.getSales(itemName) .map((sales: Sales[]) => new salesAction.ReqGetSalesSuccess(sales)) .catch(() => Observable.of(new salesAction.ReqGetSalesSuccess([]))); }); constructor(private actions$: Actions, private selesService: SalesService) { } }
  • 66. sidebar-routing.module.ts const routes: Routes = [{ path: 'events', component: EventListComponent }, { path: 'events/:num', component: EventDetailComponent }, { path: '', redirectTo: 'events' }]; @NgModule({ imports: [RouterModule.forChild(routes)], exports: [RouterModule] }) export class SidebarRoutingModule { }
  • 68. /** * Payload of ROUTER_NAVIGATION. */ export declare type RouterNavigationPayload<T> = { routerState: T; event: RoutesRecognized; }; /** * An action dispatched when the router navigates. */ export declare type RouterNavigationAction<T = RouterStateSnapshot> = { type: typeof ROUTER_NAVIGATION; payload: RouterNavigationPayload<T>; };
  • 69. EventListComponent @Component({ selector: 'app-event-list', templateUrl: './event-list.component.html', styleUrls: ['./event-list.component.scss'] }) export class EventListComponent { orderEvents: Observable<OrderEvent[]> selectedOrderEvent: OrderEvent; constructor(private store: Store<AppState>, private route: ActivatedRoute) { this.orderEvents = store.select(v => v.events.orderEvents) } }
  • 70. event-list.component.html 일부 <ul class="sidebar-list"> <li *ngFor="let event of orderEvents | async" [routerLink]="[event.orderNumber]"> <a> <span class="label label-primary pull-right">NEW</span> <h4>주문번호: {{event.orderNumber}}</h4> {{event.text}} <div class="small">수량: {{event.salesNumber}}</div> <div class="small text-muted m-t-xs">판매시간 - {{event.date | date:'medium'}}</div> </a> </li> </ul>
  • 73. ● https://css-tricks.com/learning-react-redux/ ● https://github.com/ngrx/platform ● https://gist.github.com/btroncone/a6e4347326749f938510 ● https://blog.nextzy.me/manage-action-flow-in-ngrx-with-ngrx-effects-1fda3fa06c2f reference