{"id":378,"date":"2019-09-30T09:50:17","date_gmt":"2019-09-30T01:50:17","guid":{"rendered":"http:\/\/blog.maoyunwang.top\/?p=378"},"modified":"2019-09-30T09:50:17","modified_gmt":"2019-09-30T01:50:17","slug":"2019-9-30-angular%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0%ef%bc%88%e5%9b%bd%e5%ba%86%e5%b0%8f%e9%95%bf%e5%81%87%e6%9d%a5%e4%ba%86%ef%bc%89","status":"publish","type":"post","link":"https:\/\/blog.tongyunli.top\/?p=378","title":{"rendered":"2019-9-30 angular\u5b66\u4e60\u7b14\u8bb0\uff08\u56fd\u5e86\u5c0f\u957f\u5047\u6765\u4e86\uff09"},"content":{"rendered":"<h3># <strong>\u642d\u5efa\u73af\u5883<\/strong><\/h3>\n<h2>\u5b89\u88c5nodejs<\/h2>\n<p>\u4f7f\u7528npm\u547d\u4ee4\u5b89\u88c5angular<br \/>\n<code>npm install \u2013g @angular\/cli<\/code><br \/>\n\u67e5\u770b\u5b89\u88c5\u7ed3\u679c<br \/>\n<code>ng v<\/code>\uff08\u67e5\u770b\u7248\u672c\u53f7 \u662f\u5426\u5b89\u88c5\u6210\u529f)<\/p>\n<h2>\u5b89\u88c5 TypeScript<\/h2>\n<p>(\u56e0\u4e3aangular\u57fa\u4e8ets\u5f00\u53d1\u9700\u8981ts\u505a\u7f16\u8bd1)<br \/>\n<code>npm install -g typescript<\/code><br \/>\ntsc -v (\u67e5\u770b\u7248\u672c\u53f7 \u662f\u5426\u5b89\u88c5\u6210\u529f)<br \/>\nts\u57fa\u7840\u81ea\u5df1\u770b\u53bb \u7b49\u6709\u7a7a\u5199\u4e00\u7bc7\u57fa\u7840\u603b\u7ed3<\/p>\n<h2>\u65b0\u5efaangular\u9879\u76ee<\/h2>\n<p><code>ng new \u9879\u76ee\u540d<\/code><br \/>\n\u7b49\u7740\u5427 \u7f51\u7edc\u6162\u6b7b\u4e86<\/p>\n<h2>\u65b0\u5efa\u6a21\u5757<\/h2>\n<p><code>ng g component \u6a21\u5757\u540d<\/code><\/p>\n<h2>\u5f15\u7528\u6a21\u5757<\/h2>\n<p><code>&lt;app-\u6a21\u5757\u540d&gt;&lt;\/app-\u6a21\u5757\u540d&gt;<\/code><\/p>\n<h2>\u53d8\u91cf\u58f0\u660e<\/h2>\n<p>\u58f0\u660e\u53d8\u91cf<br \/>\n\u53d8\u91cf\u540d\uff1a\u7a7a\u683c \u7c7b\u578b\uff1b<br \/>\n\u76f4\u63a5\u521d\u59cb\u5316\u53d8\u91cf\uff08\u4e0d\u9700\u8981\u5b9a\u4e49\u7c7b\u578b \u8212\u670d\uff01\uff09<br \/>\n<code>aa\u7a7a\u683c=\u7a7a\u683c1\uff1b<br \/>\naa\u7a7a\u683c=\u7a7a\u683ctrue\uff1b<br \/>\naa\u7a7a\u683c=\u7a7a\u683c\u2018\u6211\u662f\u8c01\uff1f\u2019\uff1b<\/code><\/p>\n<h2>\u7ed1\u5b9a\u6570\u636e\uff08\u76f4\u63a5\u53d6\u503c \u5439\u7206\uff01\uff09<\/h2>\n<p><code>&lt;p&gt;{{\u53d8\u91cf\u540d}}&lt;\/p&gt;<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p># \u642d\u5efa\u73af\u5883 \u5b89\u88c5nodejs \u4f7f\u7528npm\u547d\u4ee4\u5b89\u88c5angular npm install \u2013g @angula [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[21,22],"class_list":["post-378","post","type-post","status-publish","format-standard","hentry","tag-21","tag-projk"],"_links":{"self":[{"href":"https:\/\/blog.tongyunli.top\/index.php?rest_route=\/wp\/v2\/posts\/378","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.tongyunli.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.tongyunli.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.tongyunli.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.tongyunli.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=378"}],"version-history":[{"count":0,"href":"https:\/\/blog.tongyunli.top\/index.php?rest_route=\/wp\/v2\/posts\/378\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.tongyunli.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=378"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.tongyunli.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=378"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.tongyunli.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=378"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}