{"id":38901,"date":"2023-06-21T12:56:08","date_gmt":"2023-03-06T02:46:41","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/angular%e7%8e%b0%e5%9c%a8%e5%bc%95%e5%85%a5%e4%ba%86webcomponents%e5%95%a6%ef%bc%81%e5%93%87%ef%bc%81%e5%93%87%ef%bc%81%e5%93%87%ef%bc%81%ef%bd%9eangular-elements%e7%9a%84%e5%88%9d%e5%8d%b0%e8%b1%a1\/"},"modified":"2024-04-30T09:59:45","modified_gmt":"2024-04-30T01:59:45","slug":"angular%e7%8e%b0%e5%9c%a8%e5%bc%95%e5%85%a5%e4%ba%86webcomponents%e5%95%a6%ef%bc%81%e5%93%87%ef%bc%81%e5%93%87%ef%bc%81%e5%93%87%ef%bc%81%ef%bd%9eangular-elements%e7%9a%84%e5%88%9d%e5%8d%b0%e8%b1%a1","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/angular%e7%8e%b0%e5%9c%a8%e5%bc%95%e5%85%a5%e4%ba%86webcomponents%e5%95%a6%ef%bc%81%e5%93%87%ef%bc%81%e5%93%87%ef%bc%81%e5%93%87%ef%bc%81%ef%bd%9eangular-elements%e7%9a%84%e5%88%9d%e5%8d%b0%e8%b1%a1\/","title":{"rendered":"Angular\u73b0\u5728\u5f15\u5165\u4e86WebComponents\u5566\uff01\u54c7\uff01\u54c7\uff01\u54c7\uff01\uff5e@angular\/elements\u7684\u521d\u5370\u8c61\uff5e"},"content":{"rendered":"<p>\u6807\u9898\u662f\u201c\u7532\u58f3\u866b\u6765\u4e86\u554a\uff01\u554a\uff01\u554a\uff01\u201d\u7684\u6a21\u4eff\u4f5c\u54c1\u3002<\/p>\n<h1>\u4ec0\u4e48\u662f@angular\/elements\uff1f<\/h1>\n<p>@angular\/elements\u662f\u4e00\u4e2a\u7528\u4e8e\u5c06Angular\u7ec4\u4ef6\u8f6c\u6362\u4e3aWeb Components\u7684\u8f6f\u4ef6\u5305\u3002PullRequest\u57289\u670829\u65e5\u88ab\u63d0\u4ea4\uff0c10\u670828\u65e5\u901a\u8fc7\u4e86LGTM\uff0c\u5e76\u88ab\u79fb\u52a8\u5230labs\u5206\u652f\u4e0a\u3002\u8fd9\u4ecd\u7136\u662f\u4e00\u9879\u5904\u4e8e\u5b9e\u9a8c\u72b6\u6001\u7684\u5168\u65b0\u529f\u80fd\u3002<\/p>\n<p>\u8fd9\u53ef\u80fd\u6709\u4e9b\u501f\u53e3\uff0c\u4f46\u662f@angular\/elements\u7684\u65b9\u5411\u4ecd\u7136\u4e0d\u786e\u5b9a\uff0c\u6211\u81ea\u5df1\u7684\u77e5\u8bc6\u4e5f\u8fdc\u8fdc\u4e0d\u591f\u3002\u6211\u5df2\u7ecf\u5728\u6211\u7406\u89e3\u7684\u8303\u56f4\u5185\u603b\u7ed3\u4e86\u76ee\u524d\u7684\u60c5\u51b5\uff0c\u4f46\u662f\u5982\u679c\u6709\u4efb\u4f55\u6307\u6b63\u6216\u4fee\u6b63\uff0c\u8bf7\u968f\u65f6\u7559\u4e0b\u8bc4\u8bba\u6216\u7f16\u8f91\u8bf7\u6c42\uff0c\u8c22\u8c22\u3002<\/p>\n<h1>Web Components\u7684\u590d\u4e60<\/h1>\n<p>Web Components \u662f\u4e00\u4e2a\u4fc3\u8fdb\u5728HTML\/CSS\/JavaScript\u4e2d\u5b9e\u73b0\u53ef\u91cd\u590d\u4f7f\u7528\u7ec4\u4ef6\u7684\u673a\u5236\u3002<\/p>\n<p>\u5f53\u4f7f\u7528Web Components\u65f6\uff0c\u65e0\u8bba\u662f\u4ece\u54ea\u4e2a\u5e94\u7528\u7a0b\u5e8f\uff08\u4e0d\u4ec5\u9650\u4e8eAngular\uff0c\u53ea\u8981\u53ef\u4ee5\u8bbf\u95ee\u6d4f\u89c8\u5668\u7684\u7a97\u53e3\uff09\u90fd\u53ef\u4ee5\u4f7f\u7528\u7531Angular\u521b\u5efa\u7684\u81ea\u5b9a\u4e49\u6807\u7b7e\u3002\u5f53\u7136\uff0c\u53cd\u8fc7\u6765\u4e5f\u662f\u53ef\u4ee5\u7684\uff0c\u4f8b\u5982\u5728Vue\u4e2d\u521b\u5efa\u7ec4\u4ef6\u5e76\u6ce8\u518c\u4e3a\u81ea\u5b9a\u4e49\u6807\u7b7e\u540e\uff0c\u5728Angular\u4e2d\u4e5f\u53ef\u4ee5\u4f7f\u7528\u5b83\uff08\u4f46\u6709\u4e00\u4e9b\u6761\u4ef6\uff09\u3002\u6b64\u5916\uff0c\u4f5c\u4e3a\u89e3\u51b3Angular\u72ec\u6709\u60c5\u51b5\u7684\u65b9\u6848\uff0c\u8fd8\u53ef\u4ee5\u521b\u5efa\u5177\u6709\u591a\u4e2a\u5165\u53e3\u70b9\u7684Angular\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<p>\u4e3a\u4e86\u5b9e\u73b0\u8fd9\u4e00\u70b9\uff0c@angular\/elements\u4f1a\u4e3aAngular\u7ec4\u4ef6\u8fdb\u884c\u6784\u5efa\uff0c\u4ee5\u9002\u5e94Custom Elements\uff08WebComponents\u56db\u5929\u738b\u4e4b\u4e00\uff09\u7684\u63a5\u53e3\uff0c\u5e76\u53ef\u901a\u8fc7window.customElements\u8fdb\u884c\u6ce8\u518c\u3002\u4e3a\u4ec0\u4e48\u53ef\u4ee5\u5728Angular\u4e4b\u5916\u4f7f\u7528\u5462\uff1f\u56e0\u4e3aCustom Elements\u5b9a\u4e49\u4e86\u5916\u90e8\u63a5\u53e3\u89c4\u8303\u3002\u901a\u8fc7\u7ed9\u5b9a\u5c5e\u6027\u6216\u63a5\u6536\u4e8b\u4ef6\uff0c\u53ef\u4ee5\u5b9e\u73b0Angular\u4e0e\u5176\u4ed6JavaScript\u5e94\u7528\u7a0b\u5e8f\u7684\u534f\u540c\u5de5\u4f5c\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0cJavaScript\u5e94\u7528\u7a0b\u5e8f\u6307\u7684\u662f\u5728script\u6807\u7b7e\u4e2d\u7f16\u5199\u7684JavaScript\u51fd\u6570\u3002\u8bf7\u6ce8\u610f\uff0c@angular\/elements\u51e0\u4e4e\u6307\u7684\u5c31\u662fCustom Elements\u3002<\/p>\n<p>\u53ea\u51b3\u5b9a\u63a5\u53e3\u662f\u4e0d\u591f\u7684\uff0c\u8fd8\u9700\u8981\u4e00\u4e2a\u673a\u5236\u6765\u9690\u85cf\u4e3b\u673a\u7684\u5b9a\u5236\u5143\u7d20\u3002\u4e3b\u673a\u7684 CSS \u548c JavaScript \u5bf9\u8c61\u53ef\u80fd\u4f1a\u4e0e\u81ea\u5b9a\u4e49\u5143\u7d20\u5185\u90e8\u53d1\u751f\u51b2\u7a81\u6216\u88ab\u8986\u76d6\uff0c\u53cd\u8fc7\u6765\uff0c\u81ea\u5b9a\u4e49\u5143\u7d20\u7684\u5bf9\u8c61\u4e5f\u53ef\u80fd\u5bf9\u5916\u90e8\u4ea7\u751f\u5f71\u54cd\u3002\u4e3a\u6b64\uff0cShadow DOM \uff08WebComponents \u56db\u5927\u7ec4\u4ef6\u4e4b\u4e00\uff09\u63d0\u4f9b\u4e86\u4e00\u4e2a\u9690\u85cf\u4e3b\u673a\u90e8\u5206\u7684 DOM \u7a7a\u95f4\u3002<\/p>\n<p>\u6b64\u5916\uff0c\u901a\u8fc7ES\u6a21\u5757\uff08WebComponents\u56db\u5de8\u5934\u4e4b\u4e00\uff09\u53ef\u4ee5\u5728\u6d4f\u89c8\u5668\u4e2d\u5c06\u6a21\u5757\u5316\u7684\u5185\u5bb9\u5bfc\u5165\u3002\u60a8\u4e5f\u53ef\u4ee5\u5728\u6ca1\u6709\u6539\u53d8\u5f53\u524d\u73af\u5883\u7684\u60c5\u51b5\u4e0b\uff0c\u5c06Angular\u81ea\u5b9a\u4e49\u6807\u7b7e\u4e0e\u963f\u8d1d\u00b7\u5e7f\u573a\u7684\u7f51\u7ad9\u878d\u5408\u5728\u4e00\u8d77\u3002<\/p>\n<p>Web Components\u662f\u56db\u4e2a\u5f3a\u5927\u5b9e\u4f53\u7684\u5176\u4e2d\u4e00\u5458\u3002Template\uff08Web Components\u7684\u7b2c\u56db\u4e2a\u5b9e\u4f53\uff09\u662f\u4e00\u4e2a\u5728\u6d4f\u89c8\u5668\u4e2d\u52a0\u8f7d\u4f46\u5904\u4e8e\u975e\u6fc0\u6d3b\u72b6\u6001\uff08\u5373\u4e0d\u4f1a\u88ab\u6e32\u67d3\uff09\u7684HTML\u7ec4\u4ef6\u3002<\/p>\n<h1>@angular\/elements\u7684\u4e24\u4e2a\u80cc\u666f<\/h1>\n<h2>\u6d4f\u89c8\u5668\u7684\u5b9e\u73b0\u72b6\u51b5\u5f97\u5230\u4e86\u8fdb\u4e00\u6b65\u6539\u5584\u3002<\/h2>\n<p>\u9996\u5148\u7684\u80cc\u666f\u662fWeb Components\u7684\u89c4\u8303\u5236\u5b9a\u6b63\u5728\u63a8\u8fdb\uff0c\u6d4f\u89c8\u5668\u7684\u5b9e\u73b0\u4e5f\u5f00\u59cb\u5b8c\u5584\u3002\u5f53\u524d\u7684\u6d4f\u89c8\u5668\u652f\u6301\u60c5\u51b5\u5982\u4e0b\uff0c\u6d89\u53ca\u5230\u6784\u6210Web Components\u7684\u56db\u4e2a\u4e3b\u8981\u5143\u7d20\u3002<\/p>\n<p>\u76ee\u524d\uff0c\u6838\u5fc3\u7684\u81ea\u5b9a\u4e49\u5143\u7d20\u8fd8\u5305\u62ec\u9ec4\u8272\u548c\u7ea2\u8272\u884c\u8fdb\uff0c\u4f46\u53ef\u4ee5\u786e\u5b9a\u652f\u6301\u6b63\u5728Chrome\u548cSafari\u8fd9\u4e24\u4e2a\u4e3b\u8981\u79fb\u52a8\u6d4f\u89c8\u5668\u4e2d\u8fdb\u884c\u3002<\/p>\n<p>\u81ea\u5b9a\u4e49\u5143\u7d20<br \/>\nhttps:\/\/caniuse.com\/#feat=custom-elementsv1<br \/>\n\u5f71\u5b50 DOM<br \/>\nhttp:\/\/caniuse.com\/#feat=shadowdomv1<br \/>\nES \u6a21\u5757<br \/>\nhttp:\/\/caniuse.com\/#feat=es6-module<br \/>\n\u6a21\u677f<br \/>\nhttp:\/\/caniuse.com\/#feat=template<\/p>\n<h2>Angular\u7684\u7528\u4f8b\u8986\u76d6\u5df2\u7ecf\u8fbe\u5230\u4e86\u6781\u9650<\/h2>\n<p>\u4f5c\u4e3a\u7b2c\u4e8c\u4e2a\u80cc\u666f\uff0c\u6211\u4eec\u8981\u8c08\u5230 Angular \u7684\u53d1\u5c55\u95ee\u9898\u3002\u81ea\u4ece Angular2 \u4ee5\u540e\uff0c\u6211\u4eec\u4e00\u76f4\u52aa\u529b\u63a8\u52a8\u91c7\u7528 TypeScript \u548c AoT \u7f16\u8bd1\u7684\u5f3a\u5927\u5355\u9875\u5e94\u7528\uff08SPA\uff09\u5f00\u53d1\u8def\u7ebf\uff0c\u4e0e\u6b64\u540c\u65f6\uff0c\u4e3a\u4e86\u6362\u53d6\u8fd9\u79cd\u53d1\u5c55\uff0c\u6211\u4eec\u5f31\u5316\u4e86\u5f00\u53d1\u8005\u8f7b\u677e\u521b\u5efa Web \u7ec4\u4ef6\u3001\u4eab\u53d7\u5f00\u653e\u548c\u534f\u4f5c\u7684\u4e92\u8054\u7f51\u3001\u4ee5\u53ca\u4f7f\u7528\u5c0f\u5de5\u5177\u7684\u8def\u7ebf\u3002<\/p>\n<p>WordPress\u7684\u4e0b\u4e00\u4ee3\u7f16\u8f91\u5668\u6846\u67b6\u9009\u62e9\u4e2d\uff0cAngular\u65e9\u671f\u4fbf\u88ab\u6392\u9664\u5728\u5019\u9009\u4e4b\u5916\u3002\u6b64\u5916\uff0cAngular\u81ea\u8eab\u7684\u6587\u6863\u7f51\u7ad9\u5efa\u8bbe\u4e5f\u6210\u4e3a\u4e00\u4e2a\u95ee\u9898\u3002\u5173\u4e8e\u6587\u6863\u7f51\u7ad9\u7684\u80cc\u666f\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605AdventCalender\u7b2c1\u5929\u7684\u6587\u7ae0\u4e2d\u7684\u201c\u7b2c\u4e8c\u4e2a\u8f74\uff1a\u52a8\u6001\u5e94\u7528\u7a0b\u5e8f\u652f\u6301\u201d\u4e00\u8282\u3002\u5982\u679c\u4f60\u61c2\u82f1\u8bed\uff0c\u6211\u8ba4\u4e3a\u4f60\u4e5f\u4f1a\u5bf9\u6587\u7ae0\u4e2d\u63d0\u5230\u7684YouTube\u611f\u5174\u8da3\u3002\u7531\u4e8e\u542c\u529b\u6709\u9650\uff0c\u6211\u53ea\u662f\u901a\u8fc7\u5e7b\u706f\u7247\u9605\u8bfb\u4e86\u76f8\u5173\u5185\u5bb9\u3002<\/p>\n<p>\u5728\u6784\u5efaAngular\u6587\u6863\u7f51\u7ad9\u65f6\u9047\u5230\u7684\u95ee\u9898\u3002<\/p>\n<p>\u89c6\u9891\u94fe\u63a5\uff1a<br \/>\n<iframe loading=\"lazy\" title=\"AngularConnect 2017 - Day One Afternoon Saturn Track\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/__H65AsA_bE?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p>\u5e7b\u706f\u7247\u8d44\u6599\u94fe\u63a5\uff1a<br \/>\nhttps:\/\/onedrive.live.com\/view.aspx?resid=635B97DC223BC5B2!136637&#038;ithint=file%2Cpptx&#038;app=PowerPoint&#038;authkey=!AFgQoakql9CnkD0<\/p>\n<h1>\u4e3a\u4ec0\u4e48\u8981\u4f7f\u7528@angular\/elements\uff1f<\/h1>\n<h2>\u4e24\u4e2a\u65b9\u5411<\/h2>\n<p>Web Components\u53ef\u4ee5\u53ea\u4f7f\u7528HTML\/CSS\/JavaScript\u6765\u521b\u5efa\u3002\u4f7f\u7528@angular\/elements\u7684\u539f\u56e0\u662f\u53ef\u4ee5\u4f7f\u7528Angular\u5305\u8fdb\u884c\u5f00\u53d1\u3002<\/p>\n<p>\u6b63\u5982\u4e4b\u524d\u63d0\u5230\u7684\uff0c@angular\/elements\u76ee\u524d\u4ecd\u5904\u4e8e\u5b9e\u9a8c\u9636\u6bb5\u3002\u56e0\u6b64\uff0c\u529f\u80fd\u5c1a\u672a\u786e\u5b9a\uff0c\u4f7f\u7528\u6848\u4f8b\u4e5f\u5904\u4e8e\u8bd5\u63a2\u9636\u6bb5\u3002\u8fd9\u4e00\u70b9\u53ef\u4ee5\u4ece\u76ee\u524d\u53c2\u4e0e\u8be5\u9879\u76ee\u7684\u4eba\u4e2d\u53ef\u4ee5\u770b\u51fa\uff0c\u6709\u4e24\u4e2a\u91cd\u8981\u7684\u65b9\u5411\u3002<\/p>\n<p>\u76ee\u524d\uff0c\u53ef\u89c2\u6d4b\u5230\u7684\u4e24\u4e2a\u65b9\u5411\u5982\u4e0b\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">UI\u90e8\u54c1\u306e\u30d1\u30d6\u30ea\u30c3\u30b7\u30e5-ngComponents Everywhere<\/ul>\n<\/li>\n<\/ul>\n<p>\u7279\u5b9a\u306eAngular\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092Web Components\u306b\u4e57\u305b\u3001\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u7121\u95a2\u4fc2\u3067\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b<\/p>\n<p>Angular\u7279\u6709\u306e\u8ab2\u984c\u89e3\u6c7a-Dynamic Bootstraping<\/p>\n<p>Angular\u30a2\u30d7\u30ea\u5168\u4f53\u3092Web Components\u5316\u3057\u3066\u3001component\u5358\u4f4d\u3067bootstrap\u3067\u304d\u308b\u624b\u6bb5\u3092\u63d0\u4f9b\u3057\u3001\u5b9f\u884c\u30bf\u30a4\u30df\u30f3\u30b0\u3092\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b<\/p>\n<p>Rob Warmald\u5148\u751f\u662f\u8fd9\u4e2a\u63d0\u6848\u7684\u53d1\u8d77\u4eba\uff0c\u4ed6\u6700\u521d\u8bbe\u8ba1\u4e86\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684Web Components API\u3002Rob\u5148\u751f\u57286\u6708\u4efd\u53d1\u5e03\u7684angular-elements 3\u793a\u4f8b\u5e93\u4e3b\u8981\u5173\u6ce8\u53d1\u5e03\u7279\u5b9a\u7684UI\u7ec4\u4ef6\uff0c\u5b83\u5c06window.customElements.define()\u8fdb\u884c\u4e86\u5305\u88c5\uff0c\u5e76\u5141\u8bb8\u5c06\u6269\u5c55\u4e86HTMLElement\u7684Angular\u7ec4\u4ef6\u4f5c\u4e3a\u81ea\u5b9a\u4e49\u5143\u7d20\u8fdb\u884c\u53d1\u5e03\u3002\u8fd9\u4e2a\u793a\u4f8b\u5bf9\u4e8e\u6211\u8fd9\u4e2a\u4f5c\u8005\u6765\u8bf4\uff0c\u8bfb\u8d77\u6765\u5f88\u987a\u7545\uff0c\u611f\u89c9\u5f88\u5bb9\u6613\u7406\u89e3\u3002<\/p>\n<p>\u4e00\u65b9\u9762\uff0c\u5b9e\u65bd\u4e86@angular\/elements\u7684gkalpak\u5148\u751f\u4f3c\u4e4e\u975e\u5e38\u91cd\u89c6\u5c06Angular\u5e94\u7528\u7a0b\u5e8f\u7684\u5f15\u5bfc\u8fdb\u884c\u89e3\u6784\uff0c\u4f7f\u5176\u80fd\u591f\u6309\u7ec4\u4ef6\u8fdb\u884c\u81ea\u6211\u5f15\u5bfc\u3002\u8fd9\u6837\u505a\u7684\u76ee\u7684\u662f\u5c06\u73b0\u6709\u7684Angular\u5e94\u7528\u7a0b\u5e8f\u8f6c\u5316\u4e3aWeb\u7ec4\u4ef6\u3002\u4ed6\u8fd8\u63d0\u5230\uff0c@angular\/elements\u6700\u7ec8\u53ef\u80fd\u4f1a\u88ab\u5305\u542b\u5728\u6838\u5fc3\u7a0b\u5e8f\u5305\u4e2d\u3002\u8001\u5b9e\u8bf4\uff0c\u5bf9\u4e8e\u8fd9\u4e9b\u8c08\u8bba\uff0c\u4f5c\u8005\u5e76\u6ca1\u6709\u8ddf\u4e0a\u3002\u4ed6\u4eec\u6b63\u5728\u8bd5\u56fe\u5b9e\u73b0\u7684\u5185\u5bb9\u4f3c\u4e4e\u4e0e\u53e6\u4e00\u4e2a\u5b9e\u9a8c\u9879\u76eengiv\u5b58\u5728\u91cd\u53e0\uff0c\u7ed9\u4eba\u4e00\u79cd\u6d41\u52a8\u7684\u611f\u89c9\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u5f53Rob\u5728\u5341\u6708\u548c\u5341\u4e00\u6708\u4efd\u5c55\u793a@angular\/elements\u65f6\uff0c\u53cc\u65b9\u90fd\u88ab\u5305\u542b\u5728\u5185\uff0c\u6240\u4ee5\u4e24\u8005\u4f3c\u4e4e\u90fd\u662f@angular\/elements\u7684\u76ee\u6807\u3002@angular\/elements\u7684registerAsCustomElements()\u7684\u5b9a\u4e49\u4e5f\u6d89\u53ca\u8fd9\u4e24\u79cd\u591a\u6001\u6027\u3002\uff08\u4e24\u4e2aexport\u51fd\u6570 + \u5c06\u4e24\u8005\u6df7\u5408\u7684\u5b9e\u9645\u5b9e\u73b0\u5171\u8ba1\u4e09\u4e2a\u3002\uff09<\/p>\n<p>\u5e7b\u706f\u7247\u8d44\u6599<br \/>\nhttps:\/\/docs.google.com\/presentation\/d\/1jiXHYwfe1iSUiVLdKLFhSPRHLI_FmIvrI60QTpP6KLk\/mobilepresent?slide=id.g26d86d3325_0_0<br \/>\n\u4f18\u9177<br \/>\n<iframe loading=\"lazy\" title=\"Angular Labs: A Glimpse at Angular Elements by Rob Wormald\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/ljsOPm4MMEo?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<h2>\u5728\u5404\u5904\u53d1\u5e03UI\u7ec4\u4ef6\uff1angComponents<\/h2>\n<p>\u4f60\u73b0\u5728\u53ef\u4ee5\u521b\u5efa\u5e76\u5728\u4e92\u8054\u7f51\u4e0a\u53d1\u5e03\u4f60\u559c\u7231\u7684\u6f6e\u6d41\u6309\u94ae\u4e86\u3002\u4e0e\u4ee5\u5f80\u4e0d\u540c\u7684\u662f\uff0c\u4f60\u73b0\u5728\u53ef\u4ee5\u63a5\u89e6\u5230\u4e0d\u4ec5\u9650\u4e8eAngular\u7528\u6237\u7684\u4eba\u7fa4\u3002<\/p>\n<p>\u5bb9\u6613\u7406\u89e3\u7684\u662fWeb Components\u7684\u8d44\u4ea7\u5b58\u50a86\u3002\u4f8b\u5982\uff0cMaterialDesign\u76ee\u524d\u5728\u6bcf\u4e2ajs\u6846\u67b6\u4e2d\u5b9e\u73b0\uff0c\u5982Material Design Lite(JQuery)\u3001AngularMaterial\u3001Material-UI(react)\u3001VueMaterial\u3001paper-elements(polymer)\u3002\u7136\u800c\uff0c\u5982\u679c\u53ea\u9700\u8981\u6807\u51c6\u63a5\u53e3\uff0c\u901a\u8fc7\u5b58\u50a8\u63d0\u4f9bMaterialDesign\u7684\u63d0\u4f9b\uff0c\u65e0\u8bba\u4e0ejs\u6846\u67b6\u6709\u65e0\u5173\u7cfb\uff0c\u90fd\u53ef\u4ee5\u5904\u7406\u3002<\/p>\n<p>(@angular\/elements\u7684registerAsCustomElements()\u7684\u4f7f\u7528\u65b9\u6cd5\u5c06\u5728\u53e6\u4e00\u7bc7\u6587\u7ae0\u4e2d\u8be6\u7ec6\u4ecb\u7ecd\u3002)<\/p>\n<p>\u6b64\u5916\uff0cPreact\u548cAngular\u534f\u8c03\u6f14\u793a\u4e5f\u5df2\u7ecf\u5c55\u793a\u51fa\u6765\u3002\u5982\u4e0b\u6240\u793a\uff0cPreact\u7684\u7ec4\u4ef6\u5185\u4f7f\u7528JSX\u7f16\u5199\u4e86Angular\u81ea\u5b9a\u4e49\u6807\u7b7e\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"cm\">\/** @jsx h *\/<\/span>\r\n<span class=\"kd\">const<\/span> <span class=\"p\">{<\/span><span class=\"err\">\u3000<\/span><span class=\"nx\">h<\/span><span class=\"p\">,<\/span> <span class=\"nx\">render<\/span><span class=\"p\">,<\/span> <span class=\"nx\">Component<\/span> <span class=\"p\">}<\/span> <span class=\"o\">=<\/span> <span class=\"nx\">Preact<\/span><span class=\"p\">;<\/span>\r\n\r\n<span class=\"c1\">\/\/ Preac\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u666e\u901a\u306b\u4f5c\u308b<\/span>\r\n<span class=\"kd\">class<\/span> <span class=\"nx\">Demo<\/span> <span class=\"nx\">extend<\/span> <span class=\"nx\">Component<\/span> <span class=\"p\">{<\/span>\r\n  <span class=\"kd\">constructor<\/span><span class=\"p\">()<\/span> <span class=\"p\">{<\/span>\r\n    <span class=\"k\">super<\/span><span class=\"p\">();<\/span>\r\n    <span class=\"k\">this<\/span><span class=\"p\">.<\/span><span class=\"nx\">state<\/span><span class=\"p\">.<\/span><span class=\"nx\">progress<\/span> <span class=\"o\">=<\/span> <span class=\"mi\">0<\/span><span class=\"p\">;<\/span>\r\n  <span class=\"p\">}<\/span>\r\n\r\n  <span class=\"p\">...<\/span>\r\n\r\n  <span class=\"nx\">render<\/span><span class=\"p\">(<\/span><span class=\"nx\">props<\/span><span class=\"p\">,<\/span> <span class=\"nx\">state<\/span><span class=\"p\">)<\/span> <span class=\"p\">{<\/span>\r\n    <span class=\"c1\">\/\/ Angular\u306e\u30ab\u30b9\u30bf\u30e0\u30bf\u30b0\u3092\u8a18\u8ff0<\/span>\r\n    <span class=\"k\">return<\/span> <span class=\"o\">&lt;<\/span><span class=\"nx\">ng<\/span><span class=\"o\">-<\/span><span class=\"nx\">progress<\/span><span class=\"o\">-<\/span><span class=\"nx\">bar<\/span> <span class=\"nx\">progress<\/span><span class=\"o\">=<\/span><span class=\"p\">{<\/span><span class=\"nx\">state<\/span><span class=\"p\">.<\/span><span class=\"nx\">progress<\/span><span class=\"p\">}<\/span><span class=\"o\">&gt;&lt;<\/span><span class=\"sr\">\/ng-progress-bar&gt;<\/span><span class=\"err\">;\r\n<\/span>  <span class=\"p\">}<\/span>\r\n<span class=\"p\">}<\/span>\r\n\r\n<span class=\"nx\">render<\/span><span class=\"p\">(<\/span><span class=\"o\">&lt;<\/span><span class=\"nx\">Demo<\/span> <span class=\"o\">\/&gt;<\/span><span class=\"p\">,<\/span> <span class=\"nb\">document<\/span><span class=\"p\">.<\/span><span class=\"nx\">body<\/span><span class=\"p\">);<\/span>\r\n<\/code><\/pre>\n<p>\u5730\u7403\u539f\u6765\u53ea\u6709\u4e00\u4e2a\u3002<\/p>\n<h2>Angular\u6240\u72ec\u7279\u7684\u95ee\u9898\u89e3\u51b3\u65b9\u5f0f-\u52a8\u6001\u5f15\u5bfc<\/h2>\n<h3>\u8bbe\u7acb\u591a\u4e2a\u5165\u53e3\u70b9<\/h3>\n<p>\u8fd9\u662f\u4e00\u4e2a\u5b8c\u5168\u9488\u5bf9Angular\u7528\u6237\u7684\u8bf4\u660e\uff0c\u76ee\u524dAngular\u7684\u5165\u53e3\u70b9= bootstrap\u57fa\u672c\u4e0a\u53ea\u6ce8\u518c\u4e00\u4e2a\u7ec4\u4ef6\u3002bootstrap\u672c\u8eab\u662f\u4e00\u4e2a\u6570\u7ec4\uff0c\u5728\u4e4b\u524d\u63d0\u5230\u7684\u201c\u5728\u6784\u5efaAngular\u6587\u6863\u7ad9\u70b9\u65f6\u9047\u5230\u7684\u95ee\u9898\u201d\u4e2d\uff0c\u6211\u4eec\u6309\u7167\u73b0\u6709\u7684bootstrap\u5f62\u5f0f\u5c06embeddableComponents\u4f5c\u4e3a\u6570\u7ec4\u653e\u5165entryComponents\u4e2d\u3002@angular\/elements\u53ef\u4ee5\u5168\u5c40\u8986\u76d6bootstrap\u4ee5\u6ce8\u518c\u591a\u4e2a\u7ec4\u4ef6\u3002<\/p>\n<p>\u5c06main.ts\u4e2d\u7684platformBrowserDynamic().bootstrapModule(AppModule)\u66ff\u6362\u4e3aregisterAsCustomElements(webComponents, bootstrapFn)\u7684\u5f62\u5f0f\u3002<\/p>\n<p>\u7b46\u8005\u6709\u70b9\u8ddf\u4e0d\u4e0a\u7684\u91cd\u70b9\u662f\uff0c\u7528\u8fd9\u79cd\u65b9\u6cd5\uff0c\u4e0e\u73b0\u6709\u7684Angular\u5e94\u7528\u7a0b\u5e8f\u51e0\u4e4e\u6ca1\u6709\u592a\u5927\u7684\u5dee\u522b\u3002\u4ecd\u7136\u662fSPA\uff0c\u901a\u8fc7\u8def\u7531\u8fdb\u884c\u8df3\u8f6c\u3002\u53ea\u662fmain.ts\u548capp.module.ts\u7684\u63cf\u8ff0\u6709\u6240\u4e0d\u540c\uff0c\u5c31\u50cf\u662f\u5c06\u73b0\u6709\u7684Angular\u5e94\u7528\u7a0b\u5e8f\u8f6c\u5316\u4e3aWeb\u7ec4\u4ef6\u4e00\u6837\u3002\u771f\u7684\u5417\uff1f<\/p>\n<p>\u6211\u5011\u53ef\u4ee5\u901a\u904e\u4e00\u500b\u7c21\u55ae\u7684\u4f8b\u5b50\u4f86\u5c55\u793a\u5dee\u7570\u3002<\/p>\n<p>\u8fd9\u662f\u73b0\u72b6\u3002\u6211\u53ea\u662f\u4e3a\u4e86\u6bd4\u8f83\u800c\u53d1\u5e03\uff0c\u5b9e\u9645\u4e0a\u51e0\u4e4e\u662f\u521a\u4f7f\u7528angular-cli\u7684ng new\u521b\u5efa\u7684\u72b6\u6001\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"k\">import<\/span> <span class=\"p\">{<\/span> <span class=\"nx\">enableProdMode<\/span> <span class=\"p\">}<\/span> <span class=\"k\">from<\/span> <span class=\"dl\">'<\/span><span class=\"s1\">@angular\/core<\/span><span class=\"dl\">'<\/span><span class=\"p\">;<\/span>\r\n<span class=\"k\">import<\/span> <span class=\"p\">{<\/span> <span class=\"nx\">platformBrowserDynamic<\/span> <span class=\"p\">}<\/span> <span class=\"k\">from<\/span> <span class=\"dl\">'<\/span><span class=\"s1\">@angular\/platform-browser-dynamic<\/span><span class=\"dl\">'<\/span><span class=\"p\">;<\/span>\r\n\r\n<span class=\"k\">import<\/span> <span class=\"p\">{<\/span> <span class=\"nx\">AppModule<\/span> <span class=\"p\">}<\/span> <span class=\"k\">from<\/span> <span class=\"dl\">'<\/span><span class=\"s1\">.\/app\/app.module<\/span><span class=\"dl\">'<\/span><span class=\"p\">;<\/span>\r\n<span class=\"k\">import<\/span> <span class=\"p\">{<\/span> <span class=\"nx\">environment<\/span> <span class=\"p\">}<\/span> <span class=\"k\">from<\/span> <span class=\"dl\">'<\/span><span class=\"s1\">.\/environments\/environment<\/span><span class=\"dl\">'<\/span><span class=\"p\">;<\/span>\r\n\r\n<span class=\"k\">if<\/span> <span class=\"p\">(<\/span><span class=\"nx\">environment<\/span><span class=\"p\">.<\/span><span class=\"nx\">production<\/span><span class=\"p\">)<\/span> <span class=\"p\">{<\/span>\r\n  <span class=\"nx\">enableProdMode<\/span><span class=\"p\">();<\/span>\r\n<span class=\"p\">}<\/span>\r\n\r\n<span class=\"nx\">platformBrowserDynamic<\/span><span class=\"p\">().<\/span><span class=\"nx\">bootstrapModule<\/span><span class=\"p\">(<\/span><span class=\"nx\">AppModule<\/span><span class=\"p\">);<\/span>\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code><span class=\"k\">import<\/span> <span class=\"p\">{<\/span> <span class=\"nx\">NgModule<\/span> <span class=\"p\">}<\/span> <span class=\"k\">from<\/span> <span class=\"dl\">'<\/span><span class=\"s1\">@angular\/core<\/span><span class=\"dl\">'<\/span><span class=\"p\">;<\/span>\r\n<span class=\"k\">import<\/span> <span class=\"p\">{<\/span> <span class=\"nx\">BrowserModule<\/span> <span class=\"p\">}<\/span> <span class=\"k\">from<\/span> <span class=\"dl\">'<\/span><span class=\"s1\">@angular\/platform-browser<\/span><span class=\"dl\">'<\/span><span class=\"p\">;<\/span>\r\n<span class=\"k\">import<\/span> <span class=\"p\">{<\/span> <span class=\"nx\">BrowserAnimationsModule<\/span> <span class=\"p\">}<\/span> <span class=\"k\">from<\/span> <span class=\"dl\">'<\/span><span class=\"s1\">@angular\/platform-browser\/animations<\/span><span class=\"dl\">'<\/span><span class=\"p\">;<\/span>\r\n\r\n<span class=\"k\">import<\/span> <span class=\"p\">{<\/span> <span class=\"nx\">AppRoutingModule<\/span> <span class=\"p\">}<\/span> <span class=\"k\">from<\/span> <span class=\"dl\">'<\/span><span class=\"s1\">.\/app-routing.module<\/span><span class=\"dl\">'<\/span><span class=\"p\">;<\/span>\r\n<span class=\"k\">import<\/span> <span class=\"p\">{<\/span> <span class=\"nx\">AppComponent<\/span> <span class=\"p\">}<\/span> <span class=\"k\">from<\/span> <span class=\"dl\">'<\/span><span class=\"s1\">.\/app.component<\/span><span class=\"dl\">'<\/span><span class=\"p\">;<\/span>\r\n\r\n<span class=\"p\">@<\/span><span class=\"nd\">NgModule<\/span><span class=\"p\">({<\/span>\r\n  <span class=\"na\">declarations<\/span><span class=\"p\">:<\/span> <span class=\"p\">[<\/span>\r\n    <span class=\"nx\">AppComponent<\/span>\r\n  <span class=\"p\">],<\/span>\r\n  <span class=\"na\">imports<\/span><span class=\"p\">:<\/span> <span class=\"p\">[<\/span>\r\n    <span class=\"nx\">BrowserModule<\/span><span class=\"p\">,<\/span>\r\n    <span class=\"nx\">BrowserAnimationsModule<\/span><span class=\"p\">,<\/span>\r\n    <span class=\"nx\">AppRoutingModule<\/span><span class=\"p\">,<\/span>\r\n  <span class=\"p\">],<\/span>\r\n  <span class=\"na\">providers<\/span><span class=\"p\">:<\/span> <span class=\"p\">[],<\/span>\r\n  <span class=\"na\">bootstrap<\/span><span class=\"p\">:<\/span> <span class=\"p\">[<\/span><span class=\"nx\">AppComponent<\/span><span class=\"p\">]<\/span>\r\n<span class=\"p\">})<\/span>\r\n<span class=\"k\">export<\/span> <span class=\"kd\">class<\/span> <span class=\"nx\">AppModule<\/span> <span class=\"p\">{<\/span> <span class=\"p\">}<\/span>\r\n<\/code><\/pre>\n<p>\u5c06Web Components\u5316\u3002\u5728\u793a\u4f8b\u4ee3\u7801\u4e2d\u901a\u8fc7\u8bc4\u8bba\uff0c\u4f5c\u8005\u4f1a\u52a0\u4e0a\u81ea\u5df1\u7684\u56f0\u60d1\u6216\u89e3\u91ca\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"k\">import<\/span> <span class=\"p\">{<\/span> <span class=\"nx\">enableProdMode<\/span><span class=\"p\">,<\/span> <span class=\"nx\">destroyPlatform<\/span> <span class=\"p\">}<\/span> <span class=\"k\">from<\/span> <span class=\"dl\">'<\/span><span class=\"s1\">@angular\/core<\/span><span class=\"dl\">'<\/span><span class=\"p\">;<\/span>\r\n<span class=\"k\">import<\/span> <span class=\"p\">{<\/span> <span class=\"nx\">platformBrowserDynamic<\/span> <span class=\"p\">}<\/span> <span class=\"k\">from<\/span> <span class=\"dl\">'<\/span><span class=\"s1\">@angular\/platform-browser-dynamic<\/span><span class=\"dl\">'<\/span><span class=\"p\">;<\/span>\r\n<span class=\"k\">import<\/span> <span class=\"p\">{<\/span> <span class=\"nx\">registerAsCustomElements<\/span> <span class=\"p\">}<\/span> <span class=\"k\">from<\/span> <span class=\"dl\">'<\/span><span class=\"s1\">@angular\/elements<\/span><span class=\"dl\">'<\/span><span class=\"p\">;<\/span>\r\n\r\n<span class=\"k\">import<\/span> <span class=\"p\">{<\/span> <span class=\"nx\">AppModule<\/span><span class=\"p\">,<\/span> <span class=\"nx\">webComponents<\/span> <span class=\"p\">}<\/span> <span class=\"k\">from<\/span> <span class=\"dl\">'<\/span><span class=\"s1\">.\/app\/app.module<\/span><span class=\"dl\">'<\/span><span class=\"p\">;<\/span>\r\n<span class=\"k\">import<\/span> <span class=\"p\">{<\/span> <span class=\"nx\">environment<\/span> <span class=\"p\">}<\/span> <span class=\"k\">from<\/span> <span class=\"dl\">'<\/span><span class=\"s1\">.\/environments\/environment<\/span><span class=\"dl\">'<\/span><span class=\"p\">;<\/span>\r\n\r\n<span class=\"k\">if<\/span> <span class=\"p\">(<\/span><span class=\"nx\">environment<\/span><span class=\"p\">.<\/span><span class=\"nx\">production<\/span><span class=\"p\">)<\/span> <span class=\"p\">{<\/span>\r\n  <span class=\"nx\">enableProdMode<\/span><span class=\"p\">();<\/span>\r\n<span class=\"p\">}<\/span>\r\n\r\n<span class=\"c1\">\/\/ \u306a\u3093\u3060\u3053\u308c\u306f\uff01\uff1f<\/span>\r\n<span class=\"nx\">destroyPlatform<\/span><span class=\"p\">();<\/span>\r\n\r\n<span class=\"kd\">const<\/span> <span class=\"nx\">bootstrapFn<\/span> <span class=\"o\">=<\/span> <span class=\"p\">()<\/span> <span class=\"o\">=&gt;<\/span> <span class=\"nx\">platformBrowserDynamic<\/span><span class=\"p\">().<\/span><span class=\"nx\">bootstrapModule<\/span><span class=\"p\">(<\/span><span class=\"nx\">AppModule<\/span><span class=\"p\">);<\/span>\r\n<span class=\"c1\">\/\/ \u7b2c\u4e00\u5f15\u6570\u306bWebComponents\u3068\u3057\u3066\u767b\u9332\u3057\u305f\u3044component\u3092\u30bb\u30c3\u30c8\u3059\u308b\u3002<\/span>\r\n<span class=\"c1\">\/\/ \u7b2c\uff12\u5f15\u6570\u306b\u3053\u308c\u307e\u3067\u306ebootstrap\u3092\u30bb\u30c3\u30c8\u3057\u3066\u3044\u308b\u3002<\/span>\r\n<span class=\"nx\">registerAsCustomElements<\/span><span class=\"p\">(<\/span><span class=\"nx\">webComponents<\/span><span class=\"p\">,<\/span> <span class=\"nx\">bootstrapFn<\/span><span class=\"p\">)<\/span>\r\n  <span class=\"p\">.<\/span><span class=\"nx\">then<\/span><span class=\"p\">(<\/span><span class=\"nx\">moduleRef<\/span> <span class=\"o\">=&gt;<\/span> <span class=\"cm\">\/* Custom Elements are ready. Do your thing... *\/<\/span><span class=\"p\">);<\/span>\r\n  <span class=\"p\">.<\/span><span class=\"k\">catch<\/span><span class=\"p\">(<\/span><span class=\"nx\">err<\/span> <span class=\"o\">=&gt;<\/span> <span class=\"nx\">console<\/span><span class=\"p\">.<\/span><span class=\"nx\">log<\/span><span class=\"p\">(<\/span><span class=\"nx\">err<\/span><span class=\"p\">));<\/span>\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code><span class=\"k\">import<\/span> <span class=\"p\">{<\/span> <span class=\"nx\">BrowserModule<\/span> <span class=\"p\">}<\/span> <span class=\"k\">from<\/span> <span class=\"dl\">'<\/span><span class=\"s1\">@angular\/platform-browser<\/span><span class=\"dl\">'<\/span><span class=\"p\">;<\/span>\r\n<span class=\"k\">import<\/span> <span class=\"p\">{<\/span> <span class=\"nx\">NgModule<\/span> <span class=\"p\">}<\/span> <span class=\"k\">from<\/span> <span class=\"dl\">'<\/span><span class=\"s1\">@angular\/core<\/span><span class=\"dl\">'<\/span><span class=\"p\">;<\/span>\r\n<span class=\"k\">import<\/span> <span class=\"p\">{<\/span> <span class=\"nx\">BrowserAnimationsModule<\/span> <span class=\"p\">}<\/span> <span class=\"k\">from<\/span> <span class=\"dl\">'<\/span><span class=\"s1\">@angular\/platform-browser\/animations<\/span><span class=\"dl\">'<\/span><span class=\"p\">;<\/span>\r\n\r\n<span class=\"k\">import<\/span> <span class=\"p\">{<\/span> <span class=\"nx\">AppRoutingModule<\/span> <span class=\"p\">}<\/span> <span class=\"k\">from<\/span> <span class=\"dl\">'<\/span><span class=\"s1\">.\/app-routing.module<\/span><span class=\"dl\">'<\/span><span class=\"p\">;<\/span>\r\n<span class=\"k\">import<\/span> <span class=\"p\">{<\/span> <span class=\"nx\">AppComponent<\/span> <span class=\"p\">}<\/span> <span class=\"k\">from<\/span> <span class=\"dl\">'<\/span><span class=\"s1\">.\/app.component<\/span><span class=\"dl\">'<\/span><span class=\"p\">;<\/span>\r\n<span class=\"k\">import<\/span> <span class=\"p\">{<\/span> <span class=\"nx\">LikeButtonComponent<\/span> <span class=\"p\">}<\/span> <span class=\"k\">from<\/span> <span class=\"dl\">'<\/span><span class=\"s1\">.\/like-button\/like-button.component<\/span><span class=\"dl\">'<\/span><span class=\"p\">;<\/span>\r\n\r\n<span class=\"c1\">\/\/ \u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\u306b\u3057\u305f\u3044component\u3092\u4e26\u3079\u3066\u3044\u308b\u3002<\/span>\r\n<span class=\"k\">export<\/span> <span class=\"kd\">const<\/span> <span class=\"nx\">webComponents<\/span> <span class=\"o\">=<\/span> <span class=\"p\">[<\/span>\r\n  <span class=\"nx\">AppComponent<\/span><span class=\"p\">,<\/span>\r\n  <span class=\"nx\">LikeButtonComponent<\/span>\r\n<span class=\"p\">];<\/span>\r\n\r\n<span class=\"p\">@<\/span><span class=\"nd\">NgModule<\/span><span class=\"p\">({<\/span>\r\n  <span class=\"na\">declarations<\/span><span class=\"p\">:<\/span> <span class=\"p\">[<\/span>\r\n    <span class=\"p\">...<\/span><span class=\"nx\">webComponents<\/span><span class=\"p\">,<\/span>\r\n  <span class=\"p\">],<\/span>\r\n  <span class=\"c1\">\/\/ bootstrap\u306e\u30ad\u30fc\u306f\u8a18\u8ff0\u305b\u305a\u306bentryComponents\u306b\u3059\u308b<\/span>\r\n  <span class=\"na\">entryComponents<\/span><span class=\"p\">:<\/span> <span class=\"p\">[<\/span>\r\n    <span class=\"p\">...<\/span><span class=\"nx\">webComponents<\/span>\r\n  <span class=\"p\">],<\/span>\r\n  <span class=\"na\">imports<\/span><span class=\"p\">:<\/span> <span class=\"p\">[<\/span>\r\n    <span class=\"nx\">BrowserModule<\/span><span class=\"p\">,<\/span>\r\n    <span class=\"nx\">BrowserAnimationsModule<\/span><span class=\"p\">,<\/span>\r\n    <span class=\"nx\">AppRoutingModule<\/span><span class=\"p\">,<\/span>\r\n  <span class=\"p\">],<\/span>\r\n<span class=\"p\">})<\/span>\r\n<span class=\"k\">export<\/span> <span class=\"kd\">class<\/span> <span class=\"nx\">AppModule<\/span> <span class=\"p\">{<\/span>\r\n  <span class=\"c1\">\/\/ \u304a\u524d\u306f\u3069\u3053\u304b\u3089\u6765\u305f\uff1f<\/span>\r\n  <span class=\"c1\">\/\/ \u624b\u52d5\u3067bootstrap\u3059\u308b\u305f\u3081\u306e\u3082\u306e\u3089\u3057\u3044\u304c...<\/span>\r\n  <span class=\"c1\">\/\/ https:\/\/blog.angularindepth.com\/how-to-manually-bootstrap-an-angular-application-9a36ccf86429<\/span>\r\n  <span class=\"nx\">ngDoBootstrap<\/span><span class=\"p\">()<\/span> <span class=\"p\">{<\/span> <span class=\"p\">}<\/span>\r\n<span class=\"p\">}<\/span>\r\n<\/code><\/pre>\n<h3>SPA\u548cSSR\u65b9\u6cd5\u7684\u66ff\u4ee3\u9009\u9879<\/h3>\n<p>\u8fd9\u662f\u4e00\u4e2a\u6211\u5f88\u5c11\u542c\u8bf4\u8fc7\u7684\u6545\u4e8b\uff0c\u4f5c\u4e3a\u4f5c\u8005\uff0c\u6211\u8111\u6d77\u4e2d\u6784\u60f3\u7740\u4e00\u79cd\u4e0d\u4f7f\u7528router\u7684Angular\u6846\u67b6\u3002\u5b83\u662f\u4f5c\u4e3a\u975eSPA\uff08\u5355\u9875\u5e94\u7528\uff09\u5b58\u5728\u7684\uff0c\u901a\u8fc7\u670d\u52a1\u5668\u8def\u7531\u6765\u4fdd\u7559\u6a21\u677f\uff0c\u53ef\u4ee5\u5728\u9875\u9762\u6216\u540c\u4e00\u9875\u9762\u4e2d\u5d4c\u5165\u591a\u4e2aAngular\u7ec4\u4ef6\u7684\u65b9\u5f0f\u3002<\/p>\n<p>\u603b\u7684\u6765\u8bf4\uff0c\u8fd9\u662f\u4e00\u79cd\u66ff\u4ee3\u65b9\u6cd5\uff0c\u7528\u4e8e\u6784\u5efa\u9700\u8981SEO\u548cOGP\u7b49\u5e94\u7528\u7a0b\u5e8f\u670d\u52a1\u7684\u60c5\u51b5\uff0c\u5373SSR\uff08\u670d\u52a1\u5668\u7aef\u6e32\u67d3\uff09\u7684\u9700\u6c42\u53d8\u5f97\u91cd\u8981\u3002\u6211\u8ba4\u4e3aSSR\u662f\u4e00\u79cd\u5f2f\u66f2\u7684\u89e3\u51b3\u65b9\u6848\u3002\u5c31\u662f\u5c06\u6700\u521d\u5728\u670d\u52a1\u5668\u4e0a\u521b\u5efa\u7684\u6a21\u677f\u4f5c\u4e3aSPA\u5bfc\u5165\u5230\u6d4f\u89c8\u5668\u4e2d\uff0c\u7136\u540e\u518d\u8fd4\u56de\u5230\u670d\u52a1\u5668\uff0c\u7ed3\u679c\u9700\u8981\u53e6\u4e00\u4e2anode\u670d\u52a1\u5668\uff0c\u8fd9\u592a\u9ebb\u70e6\u4e86\uff01<\/p>\n<p>\u50cfRails\u548cSpring\u8fd9\u6837\u7684web\u6846\u67b6\u901a\u5e38\u90fd\u6709\u6a21\u677f\u5f15\u64ce\u3002\u5c06@angular\/elements\u4e0eESModule\u96c6\u6210\u5230\u6a21\u677f\u5f15\u64ce\u4e2d\uff0c\u5c31\u53ef\u4ee5\u6309\u7ec4\u4ef6\u5355\u5143\u8fdb\u884c\u6302\u8f7d\u3002<\/p>\n<p>\u56e0\u4e3a\u8bda\u5b9e\uff0c\u6240\u4ee5\u6211\u89c9\u5f97\u5c06\u5176\u96c6\u6210\u5230Web\u6846\u67b6\u4e2d\u53ef\u80fd\u4f1a\u5f88\u56f0\u96be\uff0c\u56e0\u4e3a\u9700\u8981\u4f7f\u7528Node\uff06Angular\u73af\u5883\u3002\u4f46\u662f\uff0c\u5982\u679c\u80fd\u591f\u50cfRails\u7684AssetPipeline\u4e00\u6837\u8fdb\u884c\u96c6\u6210\uff0c\u90a3\u5c06\u4f1a\u975e\u5e38\u65b9\u4fbf\u3002\u5173\u952e\u662f\u4f7f\u7528Custom Elements\u548cESModule\u3002<\/p>\n<p>\u53ea\u662f\uff0c\u6211\u4e5f\u8ba4\u4e3a\u53e6\u4e00\u4e2a\u5b9e\u9a8c\u9879\u76ee\u201cngiv 5\u201d\u53ef\u80fd\u4f1a\u627f\u62c5\u8d77\u8fd9\u4e2a\u89d2\u8272\uff0c\u6b63\u5982@lacolaco\u6307\u51fa\u7684\u90a3\u6837\uff0civ\u53ef\u80fd\u662fIsomorphic Viewengine\u7684\u7f29\u5199\u3002\u6211\u627e\u5230\u4e86\u4f5c\u8005\u5f53\u65f6\u516c\u5f00\u7684ngiv\u5b58\u50a8\u5e93\uff0c\u4f46\u6211\u8bb0\u5f97\u6e90\u4ee3\u7801\u4e2d\u6709\u4e00\u4e9bnode\u7684\u51fa\u73b0\uff0c\u53ef\u4ee5\u770b\u51fa\u5206\u522b\u4f7f\u7528\u4e86DOM Node\u7684\u542b\u4e49\u548cNode.js\u73af\u5883\u7684\u542b\u4e49\u3002\u6211\u53ea\u80fd\u786e\u8ba4\u5b83\u662f\u57fa\u4e8e\u6d4f\u89c8\u5668API\u7684\u3002<\/p>\n<h1>\u76ee\u524d\u9636\u6bb5\u53ef\u505a\u4e4b\u4e8b<\/h1>\n<p>\u76ee\u524d\uff0c@angular\/elements\u6b63\u5728\u5b9e\u9a8c\u6027\u7684R&amp;D\u9879\u76ee\u79f0\u4e3alab\u4e2d\u5f00\u5c55\u3002\u540c\u65f6\uff0c\u5b83\u4e5f\u5df2\u7ecf\u5728npm\u4e0a\u53d1\u5e03\uff0c\u4f9b\u4f7f\u7528\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nv\">$ <\/span>npm <span class=\"nb\">install <\/span>angular\/elements-builds#labs\/elements\r\n<\/code><\/pre>\n<p>\u5728https:\/\/github.com\/angular\/angular\/tree\/labs\/elements\u4e2d\uff0c\u8be5\u4ee3\u7801\u5e93\u63d0\u4f9b\u4e86\u5206\u652f\u9009\u62e9\u3002<\/p>\n<p>\u7b46\u8005\u66fe\u7d93\u8907\u88fd\u4e26\u5a1b\u6a02\u904e\u9019\u500b\u6a23\u677f\u5132\u5b58\u5eab\u3002\u9019\u662f\u6307\u5411\u5c07SPA\u4fdd\u6301\u4e0d\u8b8a\u4e26\u5c07\u5176\u8f49\u63db\u70baWebComponents\u65b9\u5411\u7684\u6a23\u672c\u3002<br \/>\nhttps:\/\/github.com\/playerx\/angular-elements-sample<\/p>\n<h1>\u672a\u6765\u7684\u53d1\u5c55<\/h1>\n<p>\u636e\u8bf4\u4f5c\u4e3a\u672a\u6765\u7684\u91cc\u7a0b\u7891\uff0clabs\u5c06\u6536\u96c6\u53cd\u9988\uff0c\u5e76\u8ba1\u5212\u5728\u660e\u5e744\u6708\u7684Angular6\u7248\u672c\u4e2d\u5f15\u5165\u8bd5\u9a8c\u6027\u529f\u80fd\uff0c\u76ee\u6807\u662f\u6b63\u5f0f\u53d1\u5e03\u3002\u53e6\u5916\uff0c\u5728\u5df2\u5173\u95ed\u7684Pull Request\u4e2d\uff0c\u4e8e12\u67087\u65e5\u6dfb\u52a0\u4e86\u4e00\u4e2a\u5173\u4e8e\u672a\u6765\u8def\u7ebf\u56fe\u7684\u95ee\u9898\u8bc4\u8bba\uff0cgkalpak\u5148\u751f\u56de\u7b54\u5982\u4e0b\u30024<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">core\u306b\u5165\u308b\u304b\u3082\u3057\u308c\u306a\u3044\uff1f<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">core\u306e\u5185\u90e8\u6539\u9020\u3092\u7814\u7a76\u4e2d\u3067\u3042\u308a\u3001\u305d\u308c\u3092\u53d7\u3051\u3066ngElements\u3082\u6539\u826f\u3059\u308b\u3053\u3068\u306b\u306a\u308b\u3060\u308d\u3046\uff08\u30d0\u30f3\u30c9\u30eb\u30b5\u30a4\u30ba\u306e\u524a\u6e1b\u306a\u3069\uff09<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">angular.io\u3067ngElements\u3092\u6295\u5165\u3059\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u6e96\u5099\u3059\u308b<\/ul>\n<p>\u53e6\u5916\uff0c3\u5929\u524d\uff0c\u6709\u5173\u4e8eWeb Components\u7684\u95ee\u9898\u5df2\u7ecf\u51fa\u73b0\u3002gkalpak\u5148\u751f\u6b63\u5728\u5c06\u4e0e@angular\/elements\u6709\u5173\u7684\u8bae\u9898\u5f15\u5bfc\u5230\u672c\u8ba8\u8bba\u4e32\u4e2d\u3002<br \/>\nhttps:\/\/github.com\/angular\/angular\/issues\/20859<\/p>\n<h1>\u6700\u540e<\/h1>\n<p>\u56e0\u4e3a\u8fd9\u662f\u5173\u4e8e\u672a\u6765\u7684\u8c08\u8bba\uff0c\u6240\u4ee5\u53ea\u662f\u6211\u7684\u4e3b\u89c2\u770b\u6cd5\uff0c\u4f46\u6211\u8ba4\u4e3a\u968f\u7740Web\u7ec4\u4ef6\u7684\u5168\u9762\u8fd0\u884c\uff0cJavaScript\u6846\u67b6\u7684\u65b9\u5411\u5c06\u53d8\u5f97\u89e3\u6563\u6216\u878d\u5408\u3002<\/p>\n<p>\u672c\u6587\u4e2d\u63d0\u5230\u7684\u5bf9Bootstrap\u7684\u89e3\u6784\uff0c\u53ef\u4ee5\u8bf4\u662f\u5728Angular\u7684\u4f18\u70b9\u548c\u7f3a\u70b9\u4e4b\u95f4\uff0c\u901a\u8fc7Web Components\u7684\u4ecb\u5165\u800c\u5f00\u59cb\u8fdb\u5c55\u7684\u52a8\u6001\u3002\u8fd9\u53ef\u4ee5\u770b\u4f5c\u662f\u5728React\u4e2d\uff0c\u4ecevirtualDOM\u5230Fiber\u7684\u5237\u65b0\u52a8\u6001\u3002\u5bf9\u4e8eReact\u800c\u8a00\uff0cvirtualDOM\u662f\u5176\u4f18\u70b9\uff0c\u4f46\u5728canvas\u548c\u5a92\u4f53\u65b9\u9762\u5219\u6210\u4e3a\u4e86\u5176\u5f31\u70b9\u3002Fiber\u7684\u76ee\u6807\u662f\u589e\u52a0\u8c03\u4f18\u529f\u80fd\uff0c\u4f46\u4f5c\u8005\u6ce8\u610f\u5230\u5b83\u5728\u4e0eDOM\u7684\u534f\u8c03\u65b9\u9762\u8fdb\u884c\u4e86\u8f6c\u53d8\u3002\uff08\u53ef\u4ee5\u8bf4\u662f\u4f18\u70b9\u548c\u7f3a\u70b9\u7684\u4e24\u9762\u6027\uff0c\u6839\u6e90\u8f83\u6df1\uff0c\u4e0d\u592a\u5bb9\u6613\u7b80\u5355\u89e3\u51b3\u7684\u6837\u5b50\uff09\u3002<\/p>\n<p>\u4ece\u8fc7\u53bb\u5f00\u59cb\uff0c\u4eba\u4eec\u8ba4\u4e3a\u57fa\u4e8e\u7ec4\u4ef6\u5316\u7684JavaScript\u6846\u67b6\u662f\u5bf9\u6d4f\u89c8\u5668\u5728Web Components\u5b8c\u6210\u4e4b\u524d\u7684polyfill\u3002\u867d\u7136Web Components\u5df2\u7ecf\u5b8c\u5168\u652f\u6301\uff0c\u4f46\u6211\u5e76\u4e0d\u8ba4\u4e3a\u5f53\u524d\u5c40\u90e8\u4f18\u5316\u7684\u5404\u4e2aJavaScript\u6846\u67b6\u7684\u4efb\u52a1\u5df2\u7ecf\u7ed3\u675f\u3002\u7136\u800c\uff0c\u901a\u8fc7\u9010\u6e10\u5f00\u653e\u5916\u90e8\u63a5\u53e3\uff0c\u6211\u4eec\u53ef\u4ee5\u964d\u4f4e\u4e92\u64cd\u4f5c\u6027\u7684\u95e8\u69db\u3002Angular\u548cPreact\u7684\u534f\u540c\u6f14\u793a\u662f\u4e00\u4e2a\u8c61\u5f81\u3002\u6211\u5c06\u8fd9\u79f0\u4e4b\u4e3a\u878d\u5408\u5728\u4e00\u8d77\u3002<\/p>\n<p>\u76ee\u524d\u7684\u60c5\u51b5\u4e0b\uff0c\u540c\u65f6\u4f7f\u7528\u591a\u4e2aJavaScript\u6846\u67b6\u5e76\u975e\u4ec5\u4ec5\u89e3\u51b3\u63a5\u53e3\u95ee\u9898\uff0c\u540c\u65f6\u8fd8\u4f1a\u5bfc\u81f4\u6253\u5305\u6587\u4ef6\u7684\u589e\u5927\u548c\u5f00\u53d1\u73af\u5883\u7684\u590d\u6742\u5316\u7b49\u95ee\u9898\u3002\u53ef\u4ee5\u8bf4\uff0c\u201c\u867d\u7136\u53ef\u4ee5\u505a\uff0c\u4f46\u662f\u5426\u503c\u5f97\u53bb\u505a\u201d\u662f\u4e00\u4e2a\u8ba8\u8bba\u70b9\u3002<\/p>\n<p>\u7136\u800c\uff0c\u53ea\u8981\u95ee\u9898\u5f97\u5230\u660e\u786e\u5b9a\u4e49\uff0c\u89e3\u51b3\u95ee\u9898\u5c31\u662f\u5de5\u7a0b\u5e08\u7684\u8d23\u4efb\u3002Angular\u5df2\u7ecf\u5f00\u59cb\u8fd0\u8f6c\u3002\u56e0\u6b64\uff0c\u901a\u8fc7Web\u7ec4\u4ef6\u7684\u63a8\u52a8\uff0c\u751f\u6001\u7cfb\u7edf\u548c\u6280\u672f\u4eba\u5458\u7684\u6280\u80fd\u6808\u4e5f\u4f1a\u53d1\u751f\u91cd\u5927\u53d8\u5316\uff0c\u76f8\u4e92\u64cd\u4f5c\u5c06\u5f97\u5230\u8fdb\u4e00\u6b65\u53d1\u5c55\u3002<\/p>\n<p>\u5730\u7403\u539f\u6765\u53ea\u6709\u4e00\u4e2a\u5462\uff08\u7b2c\u4e8c\u6b21\uff09<\/p>\n<p>\u4ee5\u4e0a\u662f\u3002\u660e\u5929\u662f@ponday\u5148\u751f\u3002<\/p>\n<div>\u8bf7\u53c2\u8003\u6b64\u94fe\u63a5\u4e2d\u5404\u4e2aJavaScript\u6846\u67b6\u5bf9\u81ea\u5b9a\u4e49\u5143\u7d20\u63a5\u53e3\u7684\u652f\u6301\u60c5\u51b5\u3002Angular\u548cVue\u7684\u652f\u6301\u5f97\u5206\u5f88\u9ad8\uff0c\u800cReact\u7a0d\u5fae\u62c9\u4f4e\u4e86\u6211\u4eec\u7684\u671f\u671b\u3002\u4e0d\u8fc7\uff0cPreact\u4e5f\u5728\u4e0d\u65ad\u52aa\u529b\u3002\u5982\u679c\u4f7f\u7528\u5c0f\u5199\u6216kebab-case\uff0c\u5219\u53ef\u4ee5\u8fdb\u884c\u4e8b\u4ef6\u540c\u6b65\u3002<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u6807\u9898\u662f\u201c\u7532\u58f3\u866b\u6765\u4e86\u554a\uff01\u554a\uff01\u554a\uff01\u201d\u7684\u6a21\u4eff\u4f5c\u54c1\u3002 \u4ec0\u4e48\u662f@angular\/elements\uff1f @angular\/e [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-38901","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Angular\u73b0\u5728\u5f15\u5165\u4e86WebComponents\u5566\uff01\u54c7\uff01\u54c7\uff01\u54c7\uff01\uff5e@angular\/elements\u7684\u521d\u5370\u8c61\uff5e - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/angular\u73b0\u5728\u5f15\u5165\u4e86webcomponents\u5566\uff01\u54c7\uff01\u54c7\uff01\u54c7\uff01\uff5eangular-elements\u7684\u521d\u5370\u8c61\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Angular\u73b0\u5728\u5f15\u5165\u4e86WebComponents\u5566\uff01\u54c7\uff01\u54c7\uff01\u54c7\uff01\uff5e@angular\/elements\u7684\u521d\u5370\u8c61\uff5e\" \/>\n<meta property=\"og:description\" content=\"\u6807\u9898\u662f\u201c\u7532\u58f3\u866b\u6765\u4e86\u554a\uff01\u554a\uff01\u554a\uff01\u201d\u7684\u6a21\u4eff\u4f5c\u54c1\u3002 \u4ec0\u4e48\u662f@angular\/elements\uff1f @angular\/e [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/angular\u73b0\u5728\u5f15\u5165\u4e86webcomponents\u5566\uff01\u54c7\uff01\u54c7\uff01\u54c7\uff01\uff5eangular-elements\u7684\u521d\u5370\u8c61\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-03-06T02:46:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-30T01:59:45+00:00\" \/>\n<meta name=\"author\" content=\"\u96c5, \u609f\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u96c5, \u609f\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/angular%e7%8e%b0%e5%9c%a8%e5%bc%95%e5%85%a5%e4%ba%86webcomponents%e5%95%a6%ef%bc%81%e5%93%87%ef%bc%81%e5%93%87%ef%bc%81%e5%93%87%ef%bc%81%ef%bd%9eangular-elements%e7%9a%84%e5%88%9d%e5%8d%b0%e8%b1%a1\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/angular%e7%8e%b0%e5%9c%a8%e5%bc%95%e5%85%a5%e4%ba%86webcomponents%e5%95%a6%ef%bc%81%e5%93%87%ef%bc%81%e5%93%87%ef%bc%81%e5%93%87%ef%bc%81%ef%bd%9eangular-elements%e7%9a%84%e5%88%9d%e5%8d%b0%e8%b1%a1\/\",\"name\":\"Angular\u73b0\u5728\u5f15\u5165\u4e86WebComponents\u5566\uff01\u54c7\uff01\u54c7\uff01\u54c7\uff01\uff5e@angular\/elements\u7684\u521d\u5370\u8c61\uff5e - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-03-06T02:46:41+00:00\",\"dateModified\":\"2024-04-30T01:59:45+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/angular%e7%8e%b0%e5%9c%a8%e5%bc%95%e5%85%a5%e4%ba%86webcomponents%e5%95%a6%ef%bc%81%e5%93%87%ef%bc%81%e5%93%87%ef%bc%81%e5%93%87%ef%bc%81%ef%bd%9eangular-elements%e7%9a%84%e5%88%9d%e5%8d%b0%e8%b1%a1\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/angular%e7%8e%b0%e5%9c%a8%e5%bc%95%e5%85%a5%e4%ba%86webcomponents%e5%95%a6%ef%bc%81%e5%93%87%ef%bc%81%e5%93%87%ef%bc%81%e5%93%87%ef%bc%81%ef%bd%9eangular-elements%e7%9a%84%e5%88%9d%e5%8d%b0%e8%b1%a1\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/angular%e7%8e%b0%e5%9c%a8%e5%bc%95%e5%85%a5%e4%ba%86webcomponents%e5%95%a6%ef%bc%81%e5%93%87%ef%bc%81%e5%93%87%ef%bc%81%e5%93%87%ef%bc%81%ef%bd%9eangular-elements%e7%9a%84%e5%88%9d%e5%8d%b0%e8%b1%a1\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Angular\u73b0\u5728\u5f15\u5165\u4e86WebComponents\u5566\uff01\u54c7\uff01\u54c7\uff01\u54c7\uff01\uff5e@angular\/elements\u7684\u521d\u5370\u8c61\uff5e\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6\",\"name\":\"\u96c5, \u609f\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g\",\"caption\":\"\u96c5, \u609f\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yawu\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/angular%e7%8e%b0%e5%9c%a8%e5%bc%95%e5%85%a5%e4%ba%86webcomponents%e5%95%a6%ef%bc%81%e5%93%87%ef%bc%81%e5%93%87%ef%bc%81%e5%93%87%ef%bc%81%ef%bd%9eangular-elements%e7%9a%84%e5%88%9d%e5%8d%b0%e8%b1%a1\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<meta property=\"og:video\" content=\"https:\/\/www.youtube.com\/embed\/__H65AsA_bE\" \/>\n<meta property=\"og:video:type\" content=\"text\/html\" \/>\n<meta property=\"og:video:duration\" content=\"12158\" \/>\n<meta property=\"og:video:width\" content=\"480\" \/>\n<meta property=\"og:video:height\" content=\"270\" \/>\n<meta property=\"ya:ovs:adult\" content=\"false\" \/>\n<meta property=\"ya:ovs:upload_date\" content=\"2023-03-06T02:46:41+00:00\" \/>\n<meta property=\"ya:ovs:allow_embed\" content=\"true\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Angular\u73b0\u5728\u5f15\u5165\u4e86WebComponents\u5566\uff01\u54c7\uff01\u54c7\uff01\u54c7\uff01\uff5e@angular\/elements\u7684\u521d\u5370\u8c61\uff5e - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/angular\u73b0\u5728\u5f15\u5165\u4e86webcomponents\u5566\uff01\u54c7\uff01\u54c7\uff01\u54c7\uff01\uff5eangular-elements\u7684\u521d\u5370\u8c61\/","og_locale":"zh_CN","og_type":"article","og_title":"Angular\u73b0\u5728\u5f15\u5165\u4e86WebComponents\u5566\uff01\u54c7\uff01\u54c7\uff01\u54c7\uff01\uff5e@angular\/elements\u7684\u521d\u5370\u8c61\uff5e","og_description":"\u6807\u9898\u662f\u201c\u7532\u58f3\u866b\u6765\u4e86\u554a\uff01\u554a\uff01\u554a\uff01\u201d\u7684\u6a21\u4eff\u4f5c\u54c1\u3002 \u4ec0\u4e48\u662f@angular\/elements\uff1f @angular\/e [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/angular\u73b0\u5728\u5f15\u5165\u4e86webcomponents\u5566\uff01\u54c7\uff01\u54c7\uff01\u54c7\uff01\uff5eangular-elements\u7684\u521d\u5370\u8c61\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-03-06T02:46:41+00:00","article_modified_time":"2024-04-30T01:59:45+00:00","author":"\u96c5, \u609f","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u96c5, \u609f","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/angular%e7%8e%b0%e5%9c%a8%e5%bc%95%e5%85%a5%e4%ba%86webcomponents%e5%95%a6%ef%bc%81%e5%93%87%ef%bc%81%e5%93%87%ef%bc%81%e5%93%87%ef%bc%81%ef%bd%9eangular-elements%e7%9a%84%e5%88%9d%e5%8d%b0%e8%b1%a1\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/angular%e7%8e%b0%e5%9c%a8%e5%bc%95%e5%85%a5%e4%ba%86webcomponents%e5%95%a6%ef%bc%81%e5%93%87%ef%bc%81%e5%93%87%ef%bc%81%e5%93%87%ef%bc%81%ef%bd%9eangular-elements%e7%9a%84%e5%88%9d%e5%8d%b0%e8%b1%a1\/","name":"Angular\u73b0\u5728\u5f15\u5165\u4e86WebComponents\u5566\uff01\u54c7\uff01\u54c7\uff01\u54c7\uff01\uff5e@angular\/elements\u7684\u521d\u5370\u8c61\uff5e - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-03-06T02:46:41+00:00","dateModified":"2024-04-30T01:59:45+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/angular%e7%8e%b0%e5%9c%a8%e5%bc%95%e5%85%a5%e4%ba%86webcomponents%e5%95%a6%ef%bc%81%e5%93%87%ef%bc%81%e5%93%87%ef%bc%81%e5%93%87%ef%bc%81%ef%bd%9eangular-elements%e7%9a%84%e5%88%9d%e5%8d%b0%e8%b1%a1\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/angular%e7%8e%b0%e5%9c%a8%e5%bc%95%e5%85%a5%e4%ba%86webcomponents%e5%95%a6%ef%bc%81%e5%93%87%ef%bc%81%e5%93%87%ef%bc%81%e5%93%87%ef%bc%81%ef%bd%9eangular-elements%e7%9a%84%e5%88%9d%e5%8d%b0%e8%b1%a1\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/angular%e7%8e%b0%e5%9c%a8%e5%bc%95%e5%85%a5%e4%ba%86webcomponents%e5%95%a6%ef%bc%81%e5%93%87%ef%bc%81%e5%93%87%ef%bc%81%e5%93%87%ef%bc%81%ef%bd%9eangular-elements%e7%9a%84%e5%88%9d%e5%8d%b0%e8%b1%a1\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"Angular\u73b0\u5728\u5f15\u5165\u4e86WebComponents\u5566\uff01\u54c7\uff01\u54c7\uff01\u54c7\uff01\uff5e@angular\/elements\u7684\u521d\u5370\u8c61\uff5e"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6","name":"\u96c5, \u609f","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g","caption":"\u96c5, \u609f"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yawu\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/angular%e7%8e%b0%e5%9c%a8%e5%bc%95%e5%85%a5%e4%ba%86webcomponents%e5%95%a6%ef%bc%81%e5%93%87%ef%bc%81%e5%93%87%ef%bc%81%e5%93%87%ef%bc%81%ef%bd%9eangular-elements%e7%9a%84%e5%88%9d%e5%8d%b0%e8%b1%a1\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]},"og_video":"https:\/\/www.youtube.com\/embed\/__H65AsA_bE","og_video_type":"text\/html","og_video_duration":"12158","og_video_width":"480","og_video_height":"270","ya_ovs_adult":"false","ya_ovs_upload_date":"2023-03-06T02:46:41+00:00","ya_ovs_allow_embed":"true"},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/38901","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=38901"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/38901\/revisions"}],"predecessor-version":[{"id":91232,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/38901\/revisions\/91232"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=38901"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=38901"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=38901"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}