ãªããµã³ãå§ããAngular(ãã®1)ï¼Hello World
Angular 2ã«å ¥éãããã¨æã£ãããã¤ã®ã¾ã«ãAngular 4ã«ãªã£ã¦ãã¾ããã
æã®æµãã¯æ©ããã®ã§ãã
Angularã®ãã¥ã¼ããªã¢ã«ã§åå¼·ãã¾ãã
Â
ã¨ãã£ã¿ã®ç¨æ
Angularãã¤ã³ã¹ãã¼ã«ããã¾ãã«ãã¨ãã£ã¿ãã¤ã³ã¹ãã¼ã«ãã¾ããã¨ãã£ã¿ã¯å¥½ããªãã®ä½¿ãã°ããã§ãããããã§ã¯VSCodeã使ã£ã¦ã¿ã¾ãã
Â
Â
Â
CLI QUICK START
Angularã®ãã¥ã¼ããªã¢ã«ã®CLI QUICK STARTããã£ã¦ã¿ã¾ãã
CLI Quickstart - ts - CLI-QUICKSTART
Â
ãè¶ ææã翻訳ãÂ
Angular CLIã¯Angularã§éçºããéã«å©ç¨ããã³ãã³ãã©ã¤ã³ã¤ã³ã¿ã¼ãã§ã¼ã¹ã§ãã
ãã®ã¬ã¤ãã®ç®çã¯Angular CLIã使ç¨ãã¦TypeScriptã§è¨è¿°ããAngularã®ã¢ããªã±ã¼ã·ã§ã³ããã«ãã»å®è¡ãããã¨ã§ãã
以ä¸ã®ã¹ãããã§èª¬æãã¾ãã
- éçºç°å¢ã®ã»ããã¢ãã
- ããã¸ã§ã¯ãã¨ã¹ã±ã«ãã³ã¢ããªã±ã¼ã·ã§ã³ã®ä½æ
- ã¢ããªã±ã¼ã·ã§ã³ã®å®è¡
- ã¢ããªã±ã¼ã·ã§ã³ã®ç·¨é
Â
Step1. éçºç°å¢ã®ã»ããã¢ãã
Node.jsã¨npmãã¤ã³ã¹ãã¼ã«ãã¾ããæä½ã§ãnode 6.9.x, npm 3.x.x ã使ç¨ãã¦ãã ããã
https://nodejs.org/en/download/
Â
Â
 nodeã¨npmã®ãã¼ã¸ã§ã³ã確èªã
Â
Angular CLIãã°ãã¼ãã«ã«ã¤ã³ã¹ãã¼ã«ãã¦ãã ããã
Â
å®äºã
Â
Step2. æ°è¦ããã¸ã§ã¯ãã®ä½æ
ng newã³ãã³ãã§ããã¸ã§ã¯ã(my-app)ã¨ã¹ã±ã«ãã³ã¢ããªã±ã¼ã·ã§ã³ãä½ãã¾ãã
Â
ãã°ããå¾ ã¡ã¾ããé·ãã
Â
 my-appã®ä¸ã«ããããçæããã¦ãã¾ãã
Â
Step3. ã¢ããªã±ã¼ã·ã§ã³ã®å®è¡
ããã¸ã§ã¯ãã®ãã£ã¬ã¯ããªã¸ç§»åãããµã¼ãã¼ãèµ·åãã¾ãããã
ng serveã³ãã³ãã§ãµã¼ãã¼ãèµ·åãã¾ãã
Â
ãã©ã¦ã¶ã§ã¢ããªã±ã¼ã·ã§ã³ãéãã¾ãã
Â
Step4. Angularã®ã³ã³ãã¼ãã³ããç·¨éãã
my-app\src\appãã«app.component.tsãçæããã¦ãã¾ããï¼ä¸èº«ã¯TypeScriptï¼
Â
app.component.tsãVSCodeã§éãã¾ãã
titleã®ããã¹ãã'My First Angular App'æ¸ãæãã¾ãã
Â
ä¿åããã¨ãng serveããã¡ã¤ã«ã®å¤æ´ãæ¤åºãã¦ãªãã«ããå®è¡ããããã¼ã¸ããªãã¼ãããã¾ãã
Â
åæ§ã«ãapp.component.cssãç·¨éãã¾ãã
Â
ä¿åããã¨ãng serveããã¡ã¤ã«ã®å¤æ´ãæ¤åºãã¦ãªãã«ããå®è¡ããããã¼ã¸ããªãã¼ãããã¾ãã
Â
Â
CLI QUICKSTARTã¯ä»¥ä¸ã§ãã
Â
Â
Â
Â