Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
AngularJS 1.3にBrowserify組み合わせてイベント駆動にした話
Search
OKUNOKENTARO
March 21, 2015
Programming
0
120
AngularJS 1.3にBrowserify組み合わせてイベント駆動にした話
ng-japan 2015年3月21日発表分の資料をSlideShareより再掲。
http://www.slideshare.net/armorik83/ng-japan
OKUNOKENTARO
March 21, 2015
Tweet
Share
More Decks by OKUNOKENTARO
See All by OKUNOKENTARO
トレタO/X アーキテクチャ移行記 Next.js App Router化への道のり / TORETA TECH UPDATE 1
okunokentaro
5
11k
Podcastを継続する技術 / refactoradio-240119
okunokentaro
1
170
Webアプリケーション設計の第一歩は ディレクトリの整理から / Encraft 1
okunokentaro
34
10k
JSONとJSON Schemaを改めて理解する / tokyo_study
okunokentaro
9
2.3k
それでもどうしてRecoilを使うのか / Harajuku.ts Meetup Recoil
okunokentaro
19
5.5k
TypeScriptは10年でこんなに進化しました / TechFeed Experts Night 11
okunokentaro
6
1.7k
Hasura.io RDBをサクサク作る方法はARやO/RMだけじゃなくなりました/hasura-io
okunokentaro
5
640
コードには型アノテーションよりも要件アノテーションを増やせ!/harajukuts2
okunokentaro
14
6.3k
10年と3ヶ月でWebサービスを作った話 / Piyogrammer Conference 2021
okunokentaro
2
1k
Other Decks in Programming
See All in Programming
Spring gRPC について / About Spring gRPC
mackey0225
0
220
定理証明プラットフォーム lapisla.net
abap34
1
1.7k
chibiccをCILに移植した結果 (NGK2025S版)
kekyo
PRO
0
210
Compose でデザインと実装の差異を減らすための取り組み
oidy
1
300
SpringBoot3.4の構造化ログ #kanjava
irof
2
970
AIの力でお手軽Chrome拡張機能作り
taiseiue
0
170
Lottieアニメーションをカスタマイズしてみた
tahia910
0
120
TokyoR116_BeginnersSession1_環境構築
kotatyamtema
0
110
Grafana Cloudとソラカメ
devoc
0
140
Writing documentation can be fun with plugin system
okuramasafumi
0
120
Amazon Bedrock Multi Agentsを試してきた
tm2
1
280
Amazon Q Developer Proで効率化するAPI開発入門
seike460
PRO
0
110
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Designing Experiences People Love
moore
139
23k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
366
25k
Into the Great Unknown - MozCon
thekraken
35
1.6k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Scaling GitHub
holman
459
140k
Site-Speed That Sticks
csswizardry
3
370
Reflections from 52 weeks, 52 projects
jeffersonlam
348
20k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Embracing the Ebb and Flow
colly
84
4.6k
Transcript
1.3にBrowserify組み合わせて イベント駆動にした話 ng-japan March 21, 2015
@armorik83 • ژ͔Βདྷ·ͨ͠ from Kyoto. • AngularJS Anti-patterns Ξϯνύλʔϯू •
Modern AngularJS etc.
1.4.0-beta.5 1.3.12 by own project var angular = require('angular'); console.log(angular.version);
var angular = require('angular'); console.log(angular.version); 1.4.0-beta.5 ^1.3.14 2015-02-24 !!??
Already supported • 1.3ͰBrowserifyͬͨ͠Α͏ͱ ࢥͬͨΒɺ͏ରԠͯ͠·ͨ͠ • browserify-shim is useful when
you use <=1.3.13 thlorenz/browserify-shim
Use only directive • Each .ts file has one directive
• Towards 2.0, I DON'T use service, factory, ng-controller
Isolate Scope & broadcast • Use only Directive's isolate scope
• Use only $broadcast() • But event names scattered Πϕϯτ໊จࣈྻ͕ࢄΒΔ…
Add Listener import Store = require('./store'); class DirectiveController { constructor()
{ Store.addListener(this.someMethod); } } ! class Store { addListener(listener) { this.$rootScope.$on(EVENT_NAME, listener); } ! hasChanged(err) { this.$rootScope.$broadcast(EVENT_NAME, err); } } Gather into one class ✌️
Respect for F... • An Architecture F... Action -> Dispatcher
-> Store -> View • My Angular 1.3 Project Child Directive Controller -> Dispatcher -> Store -> Root Directive • Without ng-controller, Angular DI, service, factory. Browserify is helpful us.
Find more on GitHub https://github.com/armorik83/interactive-sem/tree/latent-variable Thanks a lot!