{"id":170,"date":"2021-09-03T15:44:31","date_gmt":"2021-09-03T07:44:31","guid":{"rendered":"http:\/\/139.196.75.244\/?p=170"},"modified":"2021-09-09T15:40:08","modified_gmt":"2021-09-09T07:40:08","slug":"nodejs%e5%ad%a6%e4%b9%a0%e4%ba%8c%e3%80%8aangular%e5%ad%a6%e4%b9%a0%e4%ba%8c%e3%80%8b%e6%a8%a1%e5%9d%97","status":"publish","type":"post","link":"https:\/\/www.tianjm.cn\/?p=170","title":{"rendered":"\u300aAngular\u5b66\u4e60\u4e8c\u300b\u6a21\u5757"},"content":{"rendered":"\n<p>\u4e3a\u4ec0\u4e48\u8981\u6a21\u5757\u5316\uff1f\u65b9\u4fbf\u7ef4\u62a4\uff0c\u5206\u62c5\u538b\u529b\u3002<\/p>\n\n\n\n<p>Angular \u5e94\u7528\u662f\u6a21\u5757\u5316\u7684\uff0c\u5b83\u62e5\u6709\u81ea\u5df1\u7684\u6a21\u5757\u5316\u7cfb\u7edf\uff0c\u79f0\u4f5c&nbsp;<em>NgModule<\/em>\u3002 \u4e00\u4e2a NgModule \u5c31\u662f\u4e00\u4e2a\u5bb9\u5668\uff0c\u7528\u4e8e\u5b58\u653e\u4e00\u4e9b\u5185\u805a\u7684\u4ee3\u7801\u5757\uff0c\u8fd9\u4e9b\u4ee3\u7801\u5757\u4e13\u6ce8\u4e8e\u67d0\u4e2a\u5e94\u7528\u9886\u57df\u3001\u67d0\u4e2a\u5de5\u4f5c\u6d41\u6216\u4e00\u7ec4\u7d27\u5bc6\u76f8\u5173\u7684\u529f\u80fd\u3002 \u5b83\u53ef\u4ee5\u5305\u542b\u4e00\u4e9b\u7ec4\u4ef6\u3001\u670d\u52a1\u63d0\u4f9b\u8005\u6216\u5176\u5b83\u4ee3\u7801\u6587\u4ef6\uff0c\u5176\u4f5c\u7528\u57df\u7531\u5305\u542b\u5b83\u4eec\u7684 NgModule \u5b9a\u4e49\u3002 \u5b83\u8fd8\u53ef\u4ee5\u5bfc\u5165\u4e00\u4e9b\u7531\u5176\u5b83\u6a21\u5757\u4e2d\u5bfc\u51fa\u7684\u529f\u80fd\uff0c\u5e76\u5bfc\u51fa\u4e00\u4e9b\u6307\u5b9a\u7684\u529f\u80fd\u4f9b\u5176\u5b83 NgModule \u4f7f\u7528\u3002<\/p>\n\n\n\n<p>\u6bcf\u4e2a Angular \u5e94\u7528\u90fd\u81f3\u5c11\u6709\u4e00\u4e2a NgModule \u7c7b\uff0c\u4e5f\u5c31\u662f<a href=\"https:\/\/angular.cn\/guide\/bootstrapping\">\u6839\u6a21\u5757<\/a>\uff0c\u5b83\u4e60\u60ef\u4e0a\u547d\u540d\u4e3a&nbsp;<code>AppModule<\/code>\uff0c\u5e76\u4f4d\u4e8e\u4e00\u4e2a\u540d\u53eb&nbsp;<code>app.module.ts<\/code>&nbsp;\u7684\u6587\u4ef6\u4e2d\u3002<em>\u5f15\u5bfc<\/em>\u8fd9\u4e2a\u6839\u6a21\u5757\u5c31\u53ef\u4ee5\u542f\u52a8\u4f60\u7684\u5e94\u7528\u3002<\/p>\n\n\n\n<p>\u867d\u7136\u5c0f\u578b\u7684\u5e94\u7528\u53ef\u80fd\u53ea\u6709\u4e00\u4e2a NgModule\uff0c\u4e0d\u8fc7\u5927\u591a\u6570\u5e94\u7528\u90fd\u4f1a\u6709\u5f88\u591a<em>\u7279\u6027\u6a21\u5757<\/em>\u3002\u5e94\u7528\u7684<em>\u6839\u6a21\u5757<\/em>\u4e4b\u6240\u4ee5\u53eb\u6839\u6a21\u5757\uff0c\u662f\u56e0\u4e3a\u5b83\u53ef\u4ee5\u5305\u542b\u4efb\u610f\u6df1\u5ea6\u7684\u5c42\u6b21\u5316\u5b50\u6a21\u5757\u3002<\/p>\n\n\n\n<p>\u521b\u5efamodule\u547d\u4ee4 \u201cng g m  App\u201d  App  \u4e3amodule\u540d\u79f0<\/p>\n\n\n\n<p>\u6839 NgModule \u5b9a\u4e49<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import { NgModule } from '@angular\/core';\r\nimport { BrowserModule } from '@angular\/platform-browser';\r\n@NgModule({\r\n  imports:      &#91; BrowserModule ],\r\n  providers:    &#91; Logger ],\r\n  declarations: &#91; AppComponent ],\r\n  exports:      &#91; AppComponent ],\r\n  bootstrap:    &#91; AppComponent ]\r\n})\r\nexport class AppModule { }<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"784\" height=\"219\" src=\"http:\/\/139.196.75.244\/wp-content\/uploads\/2021\/09\/image.png\" alt=\"\" class=\"wp-image-174\" srcset=\"https:\/\/www.tianjm.cn\/wp-content\/uploads\/2021\/09\/image.png 784w, https:\/\/www.tianjm.cn\/wp-content\/uploads\/2021\/09\/image-300x84.png 300w, https:\/\/www.tianjm.cn\/wp-content\/uploads\/2021\/09\/image-768x215.png 768w\" sizes=\"(max-width: 784px) 100vw, 784px\" \/><\/figure>\n\n\n\n<p><strong>ngular \u4f1a\u4f5c\u4e3a\u4e00\u7ec4 JavaScript \u6a21\u5757\u8fdb\u884c\u52a0\u8f7d\uff0c\u4f60\u53ef\u4ee5\u628a\u5b83\u4eec\u770b\u6210\u5e93\u6a21\u5757\u3002\u6bcf\u4e2a Angular \u5e93\u7684\u540d\u79f0\u90fd\u5e26\u6709\u00a0<code>@angular<\/code>\u00a0\u524d\u7f00\u3002<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e3a\u4ec0\u4e48\u8981\u6a21\u5757\u5316\uff1f\u65b9\u4fbf\u7ef4\u62a4\uff0c\u5206\u62c5\u538b\u529b\u3002 Angular \u5e94\u7528\u662f\u6a21\u5757\u5316\u7684&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[12],"tags":[],"_links":{"self":[{"href":"https:\/\/www.tianjm.cn\/index.php?rest_route=\/wp\/v2\/posts\/170"}],"collection":[{"href":"https:\/\/www.tianjm.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tianjm.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tianjm.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tianjm.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=170"}],"version-history":[{"count":6,"href":"https:\/\/www.tianjm.cn\/index.php?rest_route=\/wp\/v2\/posts\/170\/revisions"}],"predecessor-version":[{"id":211,"href":"https:\/\/www.tianjm.cn\/index.php?rest_route=\/wp\/v2\/posts\/170\/revisions\/211"}],"wp:attachment":[{"href":"https:\/\/www.tianjm.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tianjm.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=170"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tianjm.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}