Angular(ãã¼ã¸ã§ã³ï¼ä»¥é)ã®åå¼·ããã®ï¼ã§ã
ãã¾ãã«ãä»äºãå¿ãããã¦
ã¹ãã¬ã¹ããã¾ããªããåå¼·ããããªã£ã¦è¡åè²·ãããã¦ãã¾ã£ã
ï¼ï¼ï¼ï¼ï¼åãããããããï¼ï¼ã¿ãããªããªã§ï¼
https://www.udemy.com/the-complete-guide-to-angular-2/
ãã®è¬ç¾©ã¯ã¬ãè±èªã§ããããªãã¨ãªãæå³ããããã®ã§
é©å½ã«ãã£ã¦ãã¾ã
æ©æ¢°å¦ç¿ãããã¨æããã©æ°å転æã«ã¯æé©ãâª
æ©æ¢°å¦ç¿ãæå³ãããããªãæãå¤ããã¦å¿ãä½åãæããã»ã»
è³¼å
¥ãã¦ï¼æéããããã¤ã¨
ver4ãçºè¡¨ãããã»ã»ã»orz
nodejsãå¿
è¦ã ã£ãã
ãã¼ã¸ã§ã³ãå¤ããã¦ä½¿ããªãã®ã§ä¸è¨ã®URLãåèã«ãã¦ã¤ã³ã¹ãã¼ã«ãã
http://qiita.com/tagosaku324/items/bf1fe149c38c99728c72
èªåç¨ã®ã¡ã¢ã§
vagrantã§VMãç«ã¡ä¸ãããã³ã«ã·ã§ã«ãå®è¡ãããã³ã«ä¸è¨ãå®è¡
source ~/.nvm/nvm.sh
nvm install v7.9.0
npm install -g @angular/cli
ãã®å¾ãä¸è¨ã®ã³ãã³ãã§ã¤ã³ã¹ãã¼ã«ãã§ããã¿ãã
[sudo] npm install -g @angular/cli
sudoãããã®ãã©ããã¯ç°å¢æ¬¡ç¬¬ã§èªåã®macã¯å¿
è¦ã ã£ã
vagrantã®ç°å¢ã ã¨ãããªkã£ã
ng new my-first-app
ã¤ã³ã¹ãã¼ã«ãçµãã¦ãã©ã«ãã«ç§»åãã¦
cd my-first-app ng serve hostãportãæå®ããå ´å ng serve --host 0.0.0.0 --port 9999 --live-reload true
(ãã©ã¦ã¶ãç«ã¡ä¸ãã¦)
http://localhost:4200ã«ã¢ã¯ã»ã¹ããã¨
vagrantã®å ´åã¯http://192.168.10.33:9999
app worksã¨è¡¨ç¤ºããã
ã¨ãã£ã¿ã§src/app/app.component.ts
ãéã
title = 'app works!';
â
title = 'change test app works!';
ä¿åããã¨
èªã¿è¾¼ã¿ããªã
â my-first-app git:(master) ng serve
NG Live Development Server is running on http://localhost:4200 **
Hash: b2ba9fdbb65fc7f0e415 / Time: 13297ms
chunk {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 158 kB {4} [initial] [rendered]
chunk {1} main.bundle.js, main.bundle.js.map (main) 3.62 kB {3} [initial] [rendered]
chunk {2} styles.bundle.js, styles.bundle.js.map (styles) 9.77 kB {4} [initial] [rendered]
chunk {3} vendor.bundle.js, vendor.bundle.js.map (vendor) 2.37 MB [initial] [rendered]
chunk {4} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]
webpack: Compiled successfully.
webpack: Compiling...
Hash: 0b287ce00556892bae0e n Time: 1396ms
chunk {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 158 kB {4} [initial]
chunk {1} main.bundle.js, main.bundle.js.map (main) 3.64 kB {3} [initial] [rendered]
chunk {2} styles.bundle.js, styles.bundle.js.map (styles) 9.77 kB {4} [initial]
chunk {3} vendor.bundle.js, vendor.bundle.js.map (vendor) 2.37 MB [initial]
chunk {4} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry]
webpack: Compiled successfully.
src/app/app.component.htmlã«ä¸è¨ã追å
<input type="text" [(ngmodel)]="name"> <p>{{name}}</p>
src/app/app.component.tsã«ä¸è¨ã追å
name = '';
å
¥åããã¨èªåçã«åæ ããã
å¤ãã£ã
ãã¾ãã¡ç解ãã¦ããªããã©
helloworldçãªã¨ãããªã®ã§ãã®è¾ºã§çµäº
次ã®è¨äº
masalib.hatenablog.com