{"id":7510,"date":"2016-12-30T05:07:14","date_gmt":"2016-12-29T20:07:14","guid":{"rendered":"http:\/\/www.webcyou.com\/?p=7510"},"modified":"2017-04-03T01:56:19","modified_gmt":"2017-04-02T16:56:19","slug":"angular2%e3%81%ae%e5%a7%8b%e3%82%81%e6%96%b9%e3%80%82angular2-%e5%85%ac%e5%bc%8f%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab-the-hero-editor%ef%bc%88%e7%b0%a1%e5%8d%98%e3%81%aa","status":"publish","type":"post","link":"https:\/\/www.webcyou.com\/?p=7510","title":{"rendered":"Angular2\u306e\u59cb\u3081\u65b9\u3002Angular2 \u516c\u5f0f\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb &#8211; The Hero Editor\uff08\u7c21\u5358\u306a\u548c\u8a33\uff09"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/angular_hero_edi.png\" alt=\"angular_hero_edi\" width=\"600\" height=\"300\" class=\"alignnone size-full wp-image-7575\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/angular_hero_edi.png 600w, https:\/\/www.webcyou.com\/wp-content\/uploads\/angular_hero_edi-300x150.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<h4>THE HERO EDITOR<\/h4>\n<p>\u3053\u3061\u3089\u306e\u7d9a\u304d\u3067\u3059\u3002<br \/>\n<a href=\"https:\/\/www.webcyou.com\/?p=7507\">Angular2\u306e\u59cb\u3081\u65b9\u3002Angular2 \u516c\u5f0f\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb \u2013 Introduction\uff08\u7c21\u5358\u306a\u548c\u8a33\uff09<\/a><\/p>\n<h4>Setup to develop locally<\/h4>\n<p>\u5b9f\u969b\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u958b\u767a\u306f\u3001\u304a\u4f7f\u3044\u306e\u30de\u30b7\u30f3\u306e\u30ed\u30fc\u30ab\u30eb\u958b\u767a\u74b0\u5883\u3067\u884c\u308f\u308c\u307e\u3059\u3002<\/p>\n<p>\u8a2d\u5b9a\u306e\u6307\u793a\u306b\u5f93\u3063\u3066\u3001\u300cangle-tour-of-heroes\u300d\u3068\u3044\u3046\u540d\u524d\u306e\u65b0\u3057\u3044\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u305f\u5f8c\u3001\u30d5\u30a1\u30a4\u30eb\u69cb\u9020\u3092\u6b21\u306e\u3088\u3046\u306b\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">angular-tour-of-heroes\r\n\u251c\u2500\u2500 app\r\n\u2502 \u251c\u2500\u2500 app.component.ts\r\n\u2502 \u251c\u2500\u2500 app.module.ts\r\n\u2502 \u2514\u2500\u2500 main.ts\r\n\u251c\u2500\u2500 node_modules ...\r\n\u251c\u2500\u2500 index.html\r\n\u251c\u2500\u2500 package.json\r\n\u251c\u2500\u2500 styles.css\r\n\u251c\u2500\u2500 systemjs.config.js\r\n\u2514\u2500\u2500 tsconfig.json<\/pre>\n<p>\u3053\u3061\u3089\u306e\u7ae0\u306e\u30a2\u30d7\u30ea\u306e\u52d5\u4f5c\u306f\u3001\u3053\u3061\u3089\u3067\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/angular.io\/resources\/live-examples\/toh-1\/ts\/eplnkr.html\" target=\"_blank\">live example.<\/a><\/p>\n<h4>Keep the app transpiling and running<\/h4>\n<p>TypeScript\u30b3\u30f3\u30d1\u30a4\u30e9\u3092\u8d77\u52d5\u3057\u3001\u5909\u66f4\u3092\u76e3\u8996\u3057\u3066\u304b\u3089\u30b5\u30fc\u30d0\u30fc\u3092\u8d77\u52d5\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3092\u884c\u3046\u306b\u306f\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u30a6\u30a3\u30f3\u30c9\u30a6\u3067\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ npm start<\/pre>\n<p>\u3053\u306e\u30b3\u30de\u30f3\u30c9\u306f watch\u30e2\u30fc\u30c9\u3067\u30b3\u30f3\u30d1\u30a4\u30e9\u3092\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u30b5\u30fc\u30d0\u30fc\u8d77\u52d5\u3068\u30d6\u30e9\u30a6\u30b6\u3067\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u8d77\u52d5\u3057\u3001\u5f15\u304d\u7d9a\u304d\u30d2\u30fc\u30ed\u30fc\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u69cb\u7bc9\u3057\u3066\u3044\u308b\u9593\u306f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3057\u7d9a\u3051\u307e\u3059\u3002<\/p>\n<h4>Show our Hero<\/h4>\n<p>\u30d2\u30fc\u30ed\u30fc\u30c7\u30fc\u30bf\u3092\u30a2\u30d7\u30ea\u306b\u8868\u793a\u3002<\/p>\n<p>AppComponent\u3092\u66f4\u65b0\u3057\u3066\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u540d\u306e\u30bf\u30a4\u30c8\u30eb\u30d7\u30ed\u30d1\u30c6\u30a3\u3068 &#8220;Windstorm&#8221;\u3068\u3044\u3046\u30d2\u30fc\u30ed\u30fc\u306e\u30d2\u30fc\u30ed\u30fc\u30d7\u30ed\u30d1\u30c6\u30a3\u306e2\u3064\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u6301\u3061\u307e\u3059\u3002<\/p>\n<h4>app.component.ts (AppComponent class)<\/h4>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">export class AppComponent {\r\n  title = 'Tour of Heroes';\r\n  hero = 'Windstorm';\r\n}<\/pre>\n<p>@Component\u30c7\u30b3\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u3053\u308c\u3089\u306e\u65b0\u3057\u3044\u30d7\u30ed\u30d1\u30c6\u30a3\u3078\u306e\u30c7\u30fc\u30bf\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u3067\u66f4\u65b0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">template: '&lt;h1&gt;{{title}}&lt;\/h1&gt;&lt;h2&gt;{{hero}} details!&lt;\/h2&gt;'<\/pre>\n<p>\u30d6\u30e9\u30a6\u30b6\u304c\u66f4\u65b0\u3055\u308c\u3001\u30bf\u30a4\u30c8\u30eb\u3068\u30d2\u30fc\u30ed\u30fc\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u4e8c\u91cd\u4e2d\u62ec\u5f27\u306f\u3001\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u304b\u3089\u30bf\u30a4\u30c8\u30eb\u3068\u30d2\u30fc\u30ed\u30fc\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u8aad\u307f\u8fbc\u3093\u3067\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3059\u308b\u3088\u3046\u306b\u30a2\u30d7\u30ea\u306b\u6307\u793a\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u306f\u3001\u4e00\u65b9\u5411\u30c7\u30fc\u30bf\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u306e\u300c\u88dc\u9593\u300d\u5f62\u5f0f\u3067\u3059\u3002<\/p>\n<p>\u88dc\u9593\u306e\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f\u3001\u30c7\u30fc\u30bf\u306e\u8868\u793a\u306e\u7ae0\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><a href=\"https:\/\/angular.io\/docs\/ts\/latest\/guide\/displaying-data.html\">https:\/\/angular.io\/docs\/ts\/latest\/guide\/displaying-data.html<\/a><\/p>\n<p>HTML\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3092Angular\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u30d0\u30a4\u30f3\u30c9\u3059\u308b\u3053\u3068\u3067\u3001\u30c7\u30fc\u30bf\u3092\u8868\u793a\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306f\u3001ECMAScript 2015\u30d0\u30c3\u30af\u30c6\u30a3\u30c3\u30af\uff08 `\uff09\u5185\u306e\u8907\u6570\u884c\u306e\u6587\u5b57\u5217\u3067\u3059\u3002<\/p>\n<p>\u4e00\u91cd\u5f15\u7528\u7b26\uff08 &#8216;\uff09\u3068\u540c\u3058\u6587\u5b57\u3067\u306f\u306a\u3044\u30d0\u30c3\u30af\u30c6\u30a3\u30c3\u30af\uff08 `\uff09\u306f\u3001\u8907\u6570\u884c\u306b\u308f\u305f\u308b\u6587\u5b57\u5217\u3092\u69cb\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u305f\u3081\u3001HTML\u304c\u8aad\u307f\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<h4>Hero object<\/h4>\n<p>\u73fe\u6642\u70b9\u3067\u306f\u3001\u79c1\u305f\u3061\u306e\u30d2\u30fc\u30ed\u30fc\u306f\u5358\u306a\u308b\u540d\u524d\u3067\u3059\u3002\u79c1\u305f\u3061\u306e\u30d2\u30fc\u30ed\u30fc\u306f\u3088\u308a\u591a\u304f\u306e\u7279\u6027\u3092\u5fc5\u8981\u3068\u3057\u307e\u3059\u3002\u30d2\u30fc\u30ed\u30fc\u3092\u30ea\u30c6\u30e9\u30eb\u6587\u5b57\u5217\u304b\u3089\u30af\u30e9\u30b9\u306b\u5909\u63db\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>id\u3068name\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u6301\u3064Hero\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>\u4eca\u306e\u3068\u3053\u308d\u3053\u308c\u306f\u3001app.component.ts\u30d5\u30a1\u30a4\u30eb\u306e\u6700\u4e0a\u90e8\u3001\u3064\u307e\u308aimport\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u306e\u3059\u3050\u4e0b\u306b\u7f6e\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">export class Hero {\r\n  id: number;\r\n  name: string;\r\n}<\/pre>\n<p>\u30d2\u30fc\u30ed\u30fc\u30af\u30e9\u30b9\u304c\u5b8c\u6210\u3057\u307e\u3057\u305f\u306e\u3067\u3001\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u30d2\u30fc\u30ed\u30fc\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u30d2\u30fc\u30ed\u30fc\u30bf\u30a4\u30d7\u306b\u30ea\u30d5\u30a1\u30af\u30bf\u30ea\u30f3\u30b0\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u6b21\u306b\u3001id\u304c1\u3067\u3001\u540d\u524d\u304c &#8220;Windstorm&#8221;\u3067\u521d\u671f\u5316\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">hero: Hero = {\r\n  id: 1,\r\n  name: 'Windstorm'\r\n};<\/pre>\n<p>\u30d2\u30fc\u30ed\u30fc\u3092\u6587\u5b57\u5217\u304b\u3089\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u5909\u66f4\u3057\u305f\u306e\u3067\u3001\u30d2\u30fc\u30ed\u30fc\u306ename\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u53c2\u7167\u3059\u308b\u3088\u3046\u306b\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u3092\u66f4\u65b0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">template: '&lt;h1&gt;{{title}}&lt;\/h1&gt;&lt;h2&gt;{{hero.name}} details!&lt;\/h2&gt;'<\/pre>\n<p>\u30d6\u30e9\u30a6\u30b6\u304c\u66f4\u65b0\u3055\u308c\u3001\u4e3b\u4eba\u516c\u306e\u540d\u524d\u304c\u8868\u793a\u3055\u308c\u7d9a\u3051\u307e\u3059\u3002<\/p>\n<h4>Adding more HTML<\/h4>\n<p>\u540d\u524d\u3092\u8868\u793a\u3059\u308b\u306e\u306f\u826f\u3044\u3053\u3068\u3067\u3059\u304c\u3001\u30d2\u30fc\u30ed\u30fc\u306e\u3059\u3079\u3066\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u898b\u305f\u3044\u3068\u3053\u308d\u3067\u3059\u3002<\/p>\n<p>\u30d2\u30fc\u30ed\u30fc\u306eid\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u306f&lt;div&gt;\u3092\u8ffd\u52a0\u3057\u3001\u30d2\u30fc\u30ed\u30fc\u306e\u540d\u524d\u306b\u306f&lt;div&gt;\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">template: '&lt;h1&gt;{{title}}&lt;\/h1&gt;&lt;h2&gt;{{hero.name}} details!&lt;\/h2&gt;&lt;div&gt;&lt;label&gt;id: &lt;\/label&gt;{{hero.id}}&lt;\/div&gt;&lt;div&gt;&lt;label&gt;name: &lt;\/label&gt;{{hero.name}}&lt;\/div&gt;'<\/pre>\n<p>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u6587\u5b57\u5217\u304c\u9577\u304f\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306b\u5165\u529b\u30df\u30b9\u3092\u3059\u308b\u30ea\u30b9\u30af\u3092\u907f\u3051\u308b\u305f\u3081\u3001\u3053\u308c\u3092\u8003\u616e\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h4>Multi-line template strings<\/h4>\n<p>\u6587\u5b57\u5217\u3092\u9023\u7d50\u3057\u305f\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u901f\u304f\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u3059\u304c\u3001\u8aad\u307f\u306b\u304f\u304f\u3001\u30b9\u30da\u30eb\u30df\u30b9\u3092\u767a\u751f\u3057\u304c\u3061\u3067\u3059\u3002<\/p>\n<p>\u4ee3\u308f\u308a\u306b\u3001ES2015\u3068TypeScript\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u6587\u5b57\u5217\u6a5f\u80fd\u3092\u5229\u7528\u3057\u3066\u3001\u5065\u5168\u6027\u3092\u7dad\u6301\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u5f15\u7528\u7b26\u3092\u30d0\u30c3\u30af\u30c6\u30a3\u30c3\u30af\u306b\u5909\u66f4\u3057\u3001&lt;h1&gt;\u3001&lt;h2&gt;\u3001&lt;div&gt;\u8981\u7d20\u3092\u305d\u308c\u305e\u308c\u306e\u884c\u306b\u7f6e\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">template:`\r\n&lt;h1&gt;{{title}}&lt;\/h1&gt;\r\n&lt;h2&gt;{{hero.name}} details!&lt;\/h2&gt;\r\n&lt;div&gt;&lt;label&gt;id: &lt;\/label&gt;{{hero.id}}&lt;\/div&gt;\r\n&lt;div&gt;&lt;label&gt;name: &lt;\/label&gt;{{hero.name}}&lt;\/div&gt;\r\n`<\/pre>\n<h4>Editing Our Hero<\/h4>\n<p>\u30c6\u30ad\u30b9\u30c8\u30dc\u30c3\u30af\u30b9\u3067\u4e3b\u4eba\u516c\u306e\u540d\u524d\u3092\u7de8\u96c6\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u305f\u3044\u3002<\/p>\n<p>\u30d2\u30fc\u30ed\u30fc\u306e\u540d\u524d&lt;label&gt;\u306b&lt;label&gt;\u8981\u7d20\u3068&lt;input&gt;\u8981\u7d20\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30ea\u30d5\u30a1\u30af\u30bf\u30ea\u30f3\u30b0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">template:`\r\n&lt;h1&gt;{{title}}&lt;\/h1&gt;\r\n&lt;h2&gt;{{hero.name}} details!&lt;\/h2&gt;\r\n&lt;div&gt;&lt;label&gt;id: &lt;\/label&gt;{{hero.id}}&lt;\/div&gt;\r\n&lt;div&gt;\r\n  &lt;label&gt;name: &lt;\/label&gt;\r\n  &lt;input value=&quot;{{hero.name}}&quot; placeholder=&quot;name&quot;&gt;\r\n&lt;\/div&gt;\r\n`<\/pre>\n<p>\u4e3b\u4eba\u516c\u306e\u540d\u524d\u304c&lt;input&gt;\u30c6\u30ad\u30b9\u30c8\u30dc\u30c3\u30af\u30b9\u306b\u8868\u793a\u3055\u308c\u308b\u3053\u3068\u304c\u30d6\u30e9\u30a6\u30b6\u3067\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u4f55\u304b\u304c\u6b63\u3057\u304f\u611f\u3058\u3089\u308c\u307e\u305b\u3093\u3002\u540d\u524d\u3092\u5909\u66f4\u3059\u308b\u3068\u3001\u5909\u66f4\u304c&lt;h2&gt;\u306b\u53cd\u6620\u3055\u308c\u3066\u3044\u306a\u3044\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002 <\/p>\n<p>&lt;input&gt;\u3078\u306e\u4e00\u65b9\u5411\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u3067\u306f\u3001\u671b\u307e\u3057\u3044\u52d5\u4f5c\u3092\u5f97\u3089\u308c\u307e\u305b\u3093\u3002<\/p>\n<h4>Two-Way Binding<\/h4>\n<p>\u30d2\u30fc\u30ed\u30fc\u306e\u540d\u524d\u3092&lt;input&gt;\u306b\u8868\u793a\u3057\u3001\u5909\u66f4\u3057\u3001\u30d2\u30fc\u30ed\u30fc\u306e\u540d\u524d\u306b\u30d0\u30a4\u30f3\u30c9\u3059\u308b\u305f\u3073\u306b\u305d\u308c\u3089\u306e\u5909\u66f4\u3092\u8868\u793a\u3059\u308b\u3064\u3082\u308a\u3067\u3059\u3002\u3064\u307e\u308a\u3001\u53cc\u65b9\u5411\u306e\u30c7\u30fc\u30bf\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p>\u30d5\u30a9\u30fc\u30e0\u5165\u529b\u306b\u53cc\u65b9\u5411\u30c7\u30fc\u30bf\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u3092\u4f7f\u7528\u3059\u308b\u524d\u306b\u3001Angular\u30e2\u30b8\u30e5\u30fc\u30eb\u3067FormsModule\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3092NgModule\u30c7\u30b3\u30ec\u30fc\u30bf\u306eimport\u914d\u5217\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002\u3053\u306e\u914d\u5217\u306b\u306f\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u4f7f\u7528\u3055\u308c\u308b\u5916\u90e8\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30ea\u30b9\u30c8\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3067\u3001ngModel\u3092\u542b\u3080forms\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u542b\u307e\u308c\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">import { NgModule }      from '@angular\/core';\r\nimport { BrowserModule } from '@angular\/platform-browser';\r\nimport { FormsModule }   from '@angular\/forms';\r\n\r\nimport { AppComponent }  from '.\/app.component';\r\n\r\n@NgModule({\r\n  imports: &#x5B;\r\n    BrowserModule,\r\n    FormsModule\r\n  ],\r\n  declarations: &#x5B;\r\n    AppComponent\r\n  ],\r\n  bootstrap: &#x5B; AppComponent ]\r\n})\r\n\r\nexport class AppModule { }<\/pre>\n<p>FormsModule\u3068ngModel\u306e\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f\u3001\u300c<a href=\"https:\/\/angular.io\/docs\/ts\/latest\/guide\/forms.html#ngModel\" target=\"_blank\">\u30d5\u30a9\u30fc\u30e0<\/a>\u3068<a href=\"https:\/\/angular.io\/docs\/ts\/latest\/guide\/template-syntax.html#ngModel\" target=\"_blank\">\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8<\/a>\u306e\u69cb\u6587\u300d\u306e\u7ae0\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u53cc\u65b9\u5411\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u306b\u3001ngModel\u7d44\u8fbc\u307f\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3092\u4f7f\u7528\u3059\u308b\u3088\u3046\u306b\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u66f4\u65b0\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>&lt;input&gt;\u3092\u6b21\u306eHTML\u306b\u7f6e\u304d\u63db\u3048\u307e\u3059<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">&lt;input &#x5B;(ngModel)]=&quot;hero.name&quot; placeholder=&quot;name&quot;&gt;<\/pre>\n<p>\u30d6\u30e9\u30a6\u30b6\u304c\u66f4\u65b0\u3055\u308c\u3001\u518d\u5ea6\u78ba\u8a8d\u3002\u30d2\u30fc\u30ed\u30fc\u306e\u540d\u524d\u3092\u7de8\u96c6\u3057\u3066\u3001&lt;h2&gt;\u3067\u76f4\u3061\u306b\u53cd\u6620\u3055\u308c\u305f\u5909\u66f4\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h4>The Road We\u2019ve Travelled<\/h4>\n<p>\u79c1\u305f\u3061\u304c\u4f5c\u308a\u51fa\u3057\u305f\u3082\u306e\u3092\u53d6\u308a\u306b\u884c\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u79c1\u305f\u3061\u306e\u30d2\u30fc\u30ed\u30fc\u30c4\u30a2\u30fc\u3067\u306f\u3001\u30d2\u30fc\u30ed\u30fc\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30bf\u30a4\u30c8\u30eb\u3068\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u8868\u793a\u3059\u308b\u305f\u3081\u306b\u3001\u4e8c\u91cd\u4e2d\u62ec\u5f27\u88dc\u9593\uff08\u4e00\u65b9\u5411\u30c7\u30fc\u30bf\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u306e\u4e00\u7a2e\uff09\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>ES2015\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u6587\u5b57\u5217\u3092\u4f7f\u7528\u3057\u3066\u8907\u6570\u884c\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f5c\u6210\u3057\u3001\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u8aad\u307f\u3084\u3059\u304f\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u7d44\u307f\u8fbc\u307f\u306engModel\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3092\u4f7f\u7528\u3057\u3066&lt;input&gt;\u8981\u7d20\u306b\u53cc\u65b9\u5411\u30c7\u30fc\u30bf\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u3092\u8ffd\u52a0\u3057\u305f\u5f8c\u3001\u30d2\u30fc\u30ed\u30fc\u306e\u540d\u524d\u3092\u8868\u793a\u3057\u305f\u308a\u5909\u66f4\u3057\u305f\u308a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>ngModel\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306f\u3001hero.name\u306e\u4ed6\u306e\u3059\u3079\u3066\u306e\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u3078\u306e\u5909\u66f4\u3082\u4f1d\u64ad\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30d1\u30fc\u30c4\u306e\u30e9\u30a4\u30d6\u30b5\u30f3\u30d7\u30eb\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u306b\u306f\u5b8c\u5168\u306aapp.component.ts\u304c\u3042\u308a\u307e\u3059\uff1a<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">import { Component } from '@angular\/core';\r\n\r\nexport class Hero {\r\n  id: number;\r\n  name: string;\r\n}\r\n\r\n@Component({\r\n  selector: 'my-app',\r\n  template: `\r\n    &lt;h1&gt;{{title}}&lt;\/h1&gt;\r\n    &lt;h2&gt;{{hero.name}} details!&lt;\/h2&gt;\r\n    &lt;div&gt;&lt;label&gt;id: &lt;\/label&gt;{{hero.id}}&lt;\/div&gt;\r\n    &lt;div&gt;\r\n      &lt;label&gt;name: &lt;\/label&gt;\r\n      &lt;input &#x5B;(ngModel)]=&quot;hero.name&quot; placeholder=&quot;name&quot;&gt;\r\n    &lt;\/div&gt;\r\n    `\r\n})\r\n\r\nexport class AppComponent {\r\n  title = 'Tour of Heroes';\r\n  hero: Hero = {\r\n    id: 1,\r\n    name: 'Windstorm'\r\n  };\r\n}<\/pre>\n<h4>The Road Ahead<\/h4>\n<p>\u79c1\u305f\u3061\u306e\u30d2\u30fc\u30ed\u30fc\u30c4\u30a2\u30fc\u306f\u82f1\u96c4\u30921\u3064\u3057\u304b\u8868\u793a\u305b\u305a\u3001\u82f1\u96c4\u306e\u30ea\u30b9\u30c8\u3092\u8868\u793a\u3057\u305f\u3044\u306e\u3067\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u30d2\u30fc\u30ed\u30fc\u3092\u9078\u629e\u3057\u3066\u305d\u306e\u8a73\u7d30\u3092\u8868\u793a\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u305f\u3044\u3068\u8003\u3048\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30ea\u30b9\u30c8\u3092\u53d6\u5f97\u3057\u3066\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306b\u30d0\u30a4\u30f3\u30c9\u3057\u3001\u6b21\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306e\u7ae0\u3067\u30d2\u30fc\u30ed\u30fc\u3092\u9078\u629e\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u3001\u3055\u3089\u306b\u5b66\u7fd2\u3057\u307e\u3059\u3002<\/p>\n<h4>Next Step<\/h4>\n<p><a href=\"https:\/\/www.webcyou.com\/?p=7512\">Angular2\u306e\u59cb\u3081\u65b9\u3002Angular2 \u516c\u5f0f\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb \u2013 Master\/Detail\uff08\u7c21\u5358\u306a\u548c\u8a33\uff09<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>THE HERO EDITOR \u3053\u3061\u3089\u306e\u7d9a\u304d\u3067\u3059\u3002 Angular2\u306e\u59cb\u3081\u65b9\u3002Angular2 \u516c\u5f0f\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb \u2013 Introduction\uff08\u7c21\u5358\u306a\u548c\u8a33\uff09 Setup to develop locally \u5b9f\u969b\u306e\u30a2\u30d7 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[203],"tags":[37,47,50,46,169,173,44,45,111,95,178,78,114,118],"class_list":{"0":"post-7510","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-angular2","7":"tag-iphone-","8":"tag-javascript-2","9":"tag-jquery-mobile","10":"tag-js","11":"tag-mac","12":"tag-php","13":"tag-web","15":"tag-wordpress-2","16":"tag-95","17":"tag-178","18":"tag-78","19":"tag-114","20":"tag-118"},"_links":{"self":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/7510","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7510"}],"version-history":[{"count":14,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/7510\/revisions"}],"predecessor-version":[{"id":7753,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/7510\/revisions\/7753"}],"wp:attachment":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7510"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7510"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7510"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}