{"id":39400,"date":"2023-06-06T12:02:28","date_gmt":"2023-09-21T00:38:02","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/ivy%e7%bb%99%e5%8d%95%e5%85%83%e6%b5%8b%e8%af%95%e5%b8%a6%e6%9d%a5%e7%9a%84%e5%a5%bd%e5%a4%84\/"},"modified":"2024-04-30T07:34:38","modified_gmt":"2024-04-29T23:34:38","slug":"ivy%e7%bb%99%e5%8d%95%e5%85%83%e6%b5%8b%e8%af%95%e5%b8%a6%e6%9d%a5%e7%9a%84%e5%a5%bd%e5%a4%84","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/ivy%e7%bb%99%e5%8d%95%e5%85%83%e6%b5%8b%e8%af%95%e5%b8%a6%e6%9d%a5%e7%9a%84%e5%a5%bd%e5%a4%84\/","title":{"rendered":"Ivy\u7ed9\u5355\u5143\u6d4b\u8bd5\u5e26\u6765\u7684\u597d\u5904"},"content":{"rendered":"<p>\u4eca\u5e74\u7684Angular AdoCare\u5bf9\u4e8e\u6d4b\u8bd5\u7684\u8ba8\u8bba\u975e\u5e38\u4e30\u5bcc\u3002\u6bd4\u5982\u8bf4Angular8\u5355\u5143\u6d4b\u8bd5\u6709\u95ee\u9898\u554a\uff01\u8fd8\u6709\u5728\u5199\u7b2c\u4e00\u6b21\u5355\u5143\u6d4b\u8bd5\u4e4b\u524d\uff0c\u4e3a\u4e86\u907f\u514d\u5728\u6a21\u62df\u5b9e\u73b0\u4e2d\u5361\u4f4f\u624b\u7684\u76f8\u5173\u77e5\u8bc6\u4e5f\u88ab\u4ecb\u7ecd\u4e86\u51fa\u6765\u3002<br \/>\n\u6211\u81ea\u5df1\u57283\u5e74\u524d\u7684AdoCare\u4e2d\u4e5f\u5199\u8fc7\u5173\u4e8eZone.js\u5bf9\u4e8eAngular\u6d4b\u8bd5\u7684\u8d21\u732e\u4e4b\u7c7b\u7684\u4e1c\u897f\uff0c\u6240\u4ee5\u5728Angular\u7684\u5404\u79cd\u529f\u80fd\u4e2d\uff0c\u6d4b\u8bd5\u90e8\u5206\u662f\u6211\u7279\u522b\u559c\u6b22\u7684\u4e00\u90e8\u5206\u4e4b\u4e00\u3002<\/p>\n<p>\u55ef\uff0c\u8bf4\u5230\u6700\u8fd1Angular\u4e2d\u7684\u70ed\u95e8\u8bdd\u9898\uff0c\u5f53\u7136\u4e0d\u80fd\u4e0d\u63d0Ivy\u3002<br \/>\nIvy\u672c\u8eab\u57fa\u672c\u4e0a\u662f\u5bf9\u5185\u90e8\u7ed3\u6784\u8fdb\u884c\u7684\u66f4\u6539\uff0c\u6240\u4ee5\u4e0d\u4f1a\u5bf9\u5e94\u7528\u7a0b\u5e8f\u4ee3\u7801\u672c\u8eab\u4ea7\u751f\u5f71\u54cd\uff0c\u4f46\u5b83\u662f\u5c06AoT\uff08\u63d0\u524d\u7f16\u8bd1\uff09\u7f16\u8bd1\u8bbe\u7f6e\u4e3a\u9ed8\u8ba4\u7684\u94fa\u57ab\uff0c\u8bb8\u591a\u4eba\u53ef\u80fd\u5df2\u7ecf\u542c\u8bf4\u8fc7\u5b83\u53ef\u4ee5\u51cf\u5c0f\u5305\u5927\u5c0f\uff0c\u7b80\u5316\u6784\u5efa\u8fc7\u7a0b\u7b49\u6548\u679c\u3002<\/p>\n<p>\u6211\u4eca\u5929\u60f3\u8ba8\u8bba\u7684\u4e3b\u9898\u662f\uff0c\u5173\u4e8e\u5982\u4f55\u5728Ivy\u4e0a\u8fdb\u884c\u5355\u4f53\u6d4b\u8bd5\u4ee5\u8fbe\u5230\u6781\u901f\uff01<\/p>\n<p>\u4e8b\u5b9e\u4e0a\uff0cAngular\u5b98\u65b9\u7684\u535a\u5ba2\u4e2d\u4e5f\u63d0\u5230\u4e86Ivy\u53ef\u4ee5\u6539\u5584\u5355\u5143\u6d4b\u8bd5\u6027\u80fd\u7684\u95ee\u9898\uff08\u6e90\u81ea\u201c\u73b0\u5728\u662fIvy\u517c\u5bb9\u6027\u9009\u62e9\u9884\u89c8\u7248\u7684\u65f6\u5019\u4e86\uff01\u201d\uff09\u3002<\/p>\n<blockquote><p>\u66f4\u597d\u7684\u6d4b\u8bd5\u6027\u80fd&#8211; \u5728Angular\u4e2d\uff0c\u6211\u4eec\u770b\u5230\u6846\u67b6\u5355\u5143\u6d4b\u8bd5\u5feb\u4e861.5\u500d\uff0c\u6750\u6599\u5355\u5143\u6d4b\u8bd5\u5feb\u4e862.7\u500d\uff0c\u800c\u6750\u6599\u5355\u5143\u6d4b\u8bd5\u7684\u5185\u5b58\u4f7f\u7528\u91cf\u51cf\u5c11\u4e8681%\u3002<\/p><\/blockquote>\n<h2>Angular\u7684\u55ae\u5143\u6e2c\u8a66\u975e\u5e38\u975e\u5e38\u6162\u3002<\/h2>\n<p>\u5728\u89e3\u91caIvy\u7684\u6548\u679c\u4e4b\u524d\uff0c\u5148\u8bf4\u660e\u4e00\u4e0bIvy\u4e4b\u524d\u7684\u95ee\u9898\u3002<\/p>\n<p>\u4f60\u53ef\u80fd\u80fd\u591f\u611f\u89c9\u5230\uff0c\u5728\u4e00\u5b9a\u89c4\u6a21\u4e0a\u505a\u8fc7Angular\u9879\u76ee\uff0c\u4f46\u603b\u7684\u6765\u8bf4\uff0cAngular\u7684\u5355\u5143\u6d4b\u8bd5\u672c\u8eab\u5c31\u5f88\u6162\u3002\u4e5f\u8bb8\u4f1a\u6709\u4eba\u6307\u51fa\uff1a\u201c\u4f7f\u7528webpack\u6784\u5efa\u5e76\u5728Karma\u4e2d\u542f\u52a8Chrome\u5e76\u8fd0\u884c\u6d4b\u8bd5\u5f88\u6162\uff0c\u8fd9\u662f\u65e0\u53ef\u907f\u514d\u7684\u5417\uff1f\u201d \u4f46\u8fd9\u4e0d\u662f\u5173\u952e\u95ee\u9898\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d3a0837434c4406c7c40d\/8-0.png\" alt=\"capt_profile_jit.png\" \/><\/div>\n<p>\u5728\u603b\u6267\u884c\u65f6\u95f4\u7ea6\u4e3a8\u79d2\u7684\u60c5\u51b5\u4e0b\uff0c\u53ef\u4ee5\u770b\u5230\u51fd\u6570compileModuleAndAllComponentsAsync\u5360\u7528\u4e86\u8fd16\u79d2\u7684\u65f6\u95f4\u3002\u5927\u7ea6\u5360\u603b\u65f6\u95f4\u768475%\u3002\u6839\u636e\u540d\u79f0\u53ef\u4ee5\u731c\u6d4b\uff0c\u8fd9\u662f\u4e00\u4e2a\u7528\u4e8e\u7f16\u8bd1TestBed\u6240\u9700\u6a21\u5757\u548c\u7ec4\u4ef6\u7684\u51fd\u6570\u3002\u7531\u4e8e\u662f\u7ec4\u4ef6\u7684\u7f16\u8bd1\uff0c\u6240\u4ee5\u5927\u6982\u7684\u5185\u5bb9\u662f\u89e3\u6790.html\u548c.css\uff0c\u751f\u6210\u76f8\u5e94\u7684viewDef\u7b49\u7b49\uff0c\u603b\u4e4b\u662f\u4e00\u4e2a\u770b\u8d77\u6765\u6bd4\u8f83\u6162\u7684\u64cd\u4f5c\u3002<br \/>\n\u6211\u4eec\u5728\u9a8c\u8bc1\u4e2d\u4f7f\u7528\u4e86\u4e0b\u9762\u7684\u4ee3\u7801\uff0cTestBed.configureTestingModule(&#8230;).compileComponents\u5bf9\u5e94\u4e8e\u8be5\u51fd\u6570\u7684\u8c03\u7528\u6e90\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"k\">import<\/span> <span class=\"p\">{<\/span> <span class=\"nx\">TestBed<\/span><span class=\"p\">,<\/span> <span class=\"k\">async<\/span> <span class=\"p\">}<\/span> <span class=\"k\">from<\/span> <span class=\"dl\">'<\/span><span class=\"s1\">@angular\/core\/testing<\/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\">AppModule<\/span> <span class=\"p\">}<\/span> <span class=\"k\">from<\/span> <span class=\"dl\">'<\/span><span class=\"s1\">.\/app.module<\/span><span class=\"dl\">'<\/span><span class=\"p\">;<\/span>\r\n\r\n<span class=\"nx\">describe<\/span><span class=\"p\">(<\/span><span class=\"dl\">'<\/span><span class=\"s1\">AppComponent<\/span><span class=\"dl\">'<\/span><span class=\"p\">,<\/span> <span class=\"p\">()<\/span> <span class=\"o\">=&gt;<\/span> <span class=\"p\">{<\/span>\r\n  <span class=\"nx\">beforeEach<\/span><span class=\"p\">(<\/span><span class=\"k\">async<\/span><span class=\"p\">(()<\/span> <span class=\"o\">=&gt;<\/span> <span class=\"p\">{<\/span>\r\n    <span class=\"nx\">TestBed<\/span><span class=\"p\">.<\/span><span class=\"nx\">configureTestingModule<\/span><span class=\"p\">({<\/span>\r\n      <span class=\"na\">imports<\/span><span class=\"p\">:<\/span> <span class=\"p\">[<\/span>\r\n        <span class=\"nx\">AppModule<\/span><span class=\"p\">,<\/span>\r\n      <span class=\"p\">],<\/span>\r\n    <span class=\"p\">}).<\/span><span class=\"nx\">compileComponents<\/span><span class=\"p\">();<\/span> <span class=\"c1\">\/\/ \u3053\u308c<\/span>\r\n  <span class=\"p\">}));<\/span>\r\n\r\n  <span class=\"p\">[...<\/span><span class=\"k\">new<\/span> <span class=\"nb\">Array<\/span><span class=\"p\">(<\/span><span class=\"mi\">100<\/span><span class=\"p\">).<\/span><span class=\"nx\">keys<\/span><span class=\"p\">()].<\/span><span class=\"nx\">forEach<\/span><span class=\"p\">(<\/span><span class=\"nx\">i<\/span> <span class=\"o\">=&gt;<\/span> <span class=\"p\">{<\/span>\r\n    <span class=\"nx\">it<\/span><span class=\"p\">(<\/span><span class=\"dl\">'<\/span><span class=\"s1\">should create the app<\/span><span class=\"dl\">'<\/span> <span class=\"o\">+<\/span> <span class=\"nx\">i<\/span><span class=\"p\">,<\/span> <span class=\"p\">()<\/span> <span class=\"o\">=&gt;<\/span> <span class=\"p\">{<\/span>\r\n      <span class=\"kd\">const<\/span> <span class=\"nx\">fixture<\/span> <span class=\"o\">=<\/span> <span class=\"nx\">TestBed<\/span><span class=\"p\">.<\/span><span class=\"nx\">createComponent<\/span><span class=\"p\">(<\/span><span class=\"nx\">AppComponent<\/span><span class=\"p\">);<\/span>\r\n      <span class=\"kd\">const<\/span> <span class=\"nx\">app<\/span> <span class=\"o\">=<\/span> <span class=\"nx\">fixture<\/span><span class=\"p\">.<\/span><span class=\"nx\">debugElement<\/span><span class=\"p\">.<\/span><span class=\"nx\">componentInstance<\/span><span class=\"p\">;<\/span>\r\n      <span class=\"nx\">expect<\/span><span class=\"p\">(<\/span><span class=\"nx\">app<\/span><span class=\"p\">).<\/span><span class=\"nx\">toBeTruthy<\/span><span class=\"p\">();<\/span>\r\n    <span class=\"p\">});<\/span>\r\n  <span class=\"p\">});<\/span>\r\n<span class=\"p\">});<\/span>\r\n<\/code><\/pre>\n<p>\u5982\u679c\u50cf\u4e0a\u9762\u7684\u4ee3\u7801\u4e00\u6837\uff0c\u5c06Module\u5b8c\u5168\u5bfc\u5165TestBed\uff0c\u90a3\u4e48\u8be5Module\u4e2d\u7684\u6240\u6709Component\u7684\u7f16\u8bd1\u5c06\u5728\u6bcf\u4e2aspec\u4e2d\u90fd\u4f1a\u6267\u884c\u3002\u8fd9\u610f\u5473\u7740\u6d4b\u8bd5\u7684\u6267\u884c\u65f6\u95f4\u5c06\u968f\u7740Component\u7684\u6570\u91cf\u5448\u975e\u7ebf\u6027\u589e\u957f\uff0c\u5373$O(n^2)$\u3002<\/p>\n<p>\u9019\u6b21\u7684\u4f8b\u5b50\u53ea\u662f\u5275\u5efa\u4e86100\u500b ng g c \u7684\u7d44\u4ef6\u548c100\u500b Jasmine \u7684\u55ae\u5143\u6e2c\u8a66\uff0c\u4f46\u5be6\u969b\u7684\u61c9\u7528\u4e2d\uff0c\u7d44\u4ef6\u7684 HTML \u548c CSS \u6703\u66f4\u52a0\u8907\u96dc\uff0c\u6bcf\u500b\u7d44\u4ef6\u7684\u6e2c\u8a66\u6578\u91cf\u4e5f\u6703\u66f4\u591a\uff08\u5982\u679c\u6709\u5beb\u597d\u6e2c\u8a66\u7684\u8a71\uff09\u3002<br \/>\n\u53ea\u662f\u9032\u884c\u4e86\u4e00\u500b\u5c0f\u4fee\u6539\uff0c\u537b\u9700\u8981\u5728 CI \u4e2d\u7b49\u5f85 Karma \u6578\u5206\u9418\uff0c\u9019\u662f\u6211\u4e0d\u60f3\u8981\u7684\u3002<\/p>\n<h2>\u5e38\u5e38\u8d85\u4e4e\u60f3\u8c61<\/h2>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d3a0837434c4406c7c40d\/14-0.png\" alt=\"capt_profile_ivy.png\" \/><\/div>\n<p>\u5173\u4e8e\u8fd9\u4e00\u70b9\uff0c\u6b63\u5982\u5148\u524d\u6240\u8ff0\uff0c\u5728\u4f20\u7edf\u7684Angular\u5355\u5143\u6d4b\u8bd5\u4e2d\uff0c\u201c\u968f\u7740\u7ec4\u4ef6\u6570\u91cf\u7684\u589e\u52a0\uff0c\u7f16\u8bd1\u65f6\u95f4\u5c06\u5360\u7528\u5927\u91cf\u6d4b\u8bd5\u6267\u884c\u65f6\u95f4\u201d\u3002\u56e0\u6b64\uff0c\u524a\u51cf\u7f16\u8bd1\u65f6\u95f4\u662f\u975e\u5e38\u4ee4\u4eba\u9ad8\u5174\u7684\u3002<\/p>\n<p>Ivy\u662f\u975e\u5e38\u597d\u7684\u3002\u5982\u4e0b\u6240\u8ff0\uff0c\u4ee5\u524d\u8981\u524a\u51cf\u6d4b\u8bd5\u6267\u884c\u65f6\u95f4\u9700\u8981\u4e00\u4e9b\u7279\u6b8a\u7684\u6280\u5de7\uff0c\u4f46\u662f\u5bf9\u4e8eIvy\u6765\u8bf4\uff0c\u53ea\u9700\u8981\u7b80\u5355\u5730\u542f\u7528\u5b83\uff0c\u751a\u81f3\u4eceAngular 9.x\u5f00\u59cb\uff0cIvy\u9ed8\u8ba4\u5c31\u88ab\u542f\u7528\u4e86\uff0c\u6240\u4ee5\u6211\u4eec\u7ec8\u4e8e\u6446\u8131\u4e86\u8fd9\u4e2a\u70e6\u607c\u3002<\/p>\n<h2>\u4e3a\u4ec0\u4e48\u4f1a\u53d1\u751f\u52a0\u901f\uff1f<\/h2>\n<p>\u6211\u60f3\u4ece\u8fd9\u91cc\u5f00\u59cb\u6df1\u5165\u4e00\u4e9b\u795e\u7ecf\u8d28\u7684\u5185\u5bb9\u3002<\/p>\n<p>\u8fd9\u6b21\u7684\u6587\u7ae0\u91cc\uff0c\u6211\u5df2\u7ecf\u63d0\u5230\u4e86\u6700\u60f3\u8bf4\u7684\u201cIvy\u592a\u68d2\u4e86\uff01\u6d4b\u8bd5\u901f\u5ea6\u5feb\u4e86\uff01\u592a\u5f00\u5fc3\u4e86\uff01\u201d\u4f46\u5982\u679c\u5c31\u8fd9\u6837\u6536\u5c3e\uff0c\u6709\u70b9\u50cf\u4e2a\u50bb\u5b50\uff0c\u6240\u4ee5\u65e2\u7136\u5982\u6b64\uff0c\u6211\u60f3\u518d\u8be6\u7ec6\u8ffd\u8ff0\u4e00\u4e0b\u4e3a\u4ec0\u4e48\u8fdb\u884c\u52a0\u901f\u3002<\/p>\n<h3>\u95ee\uff1a\u8fd9\u4e0e\u300a\u8fdb\u51fb\u7684\u5de8\u4eba\u300b\u6709\u5173\u7cfb\u5417\uff1f \u7b54\uff1a\u5b9e\u9645\u4e0a\uff0c\u90a3\u4e0e\u6b64\u65e0\u5173\u3002<\/h3>\n<p>\u5f53\u6211\u542c\u5230\u201cIvy\u6709\u52a9\u4e8e\u5355\u5143\u6d4b\u8bd5\u6027\u80fd\u7684\u63d0\u5347\u201d\u8fd9\u53e5\u8bdd\u65f6\uff0c\u6211\u6700\u521d\u60f3\u5230\u7684\u662fIvy\u548c\u9ed8\u8ba4\u7684AoT\u4e4b\u95f4\u7684\u5173\u7cfb\u3002<\/p>\n<p>\u5b9e\u9645\u4e0a\uff0c\u5982\u679c\u8981\u624b\u52a8\u542f\u7528Ivy\uff0c\u4ee5\u4e0b\u662f\u76f8\u5e94\u7684\u6b65\u9aa4\uff0c\u8fd9\u91cc\u8fd8\u63d0\u5230\u4e86&#8221;\u5728\u6784\u5efa\u4e2d\u542f\u7528AoT&#8221;\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">tsconfig.json\u306b enableIvy: true \u3092\u8a18\u8ff0<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">angular.json\u306e build architect\u306b\u3066\u3001 aot: true \u3092\u8a18\u8ff0<\/ul>\n<p>\u5728Ivy\u6d4b\u8bd5\u74f6\u9888\u4e2d\uff0ccompileModuleAndAllComponentsAsync\u662f\u4e00\u4e2a\u6267\u884cJiT\u7f16\u8bd1\u7684\u51fd\u6570\uff0c\u6240\u4ee5\u6211\u60f3\uff1a\u201c\u5982\u679c\u5728Karma\u6d4b\u8bd5\u4e2d\u6fc0\u6d3bAoT\uff0c\u90a3\u4e48\u4e0d\u518d\u8fdb\u884c\u8fd0\u884c\u65f6\u7f16\u8bd1\uff0c\u901f\u5ea6\u4f1a\u66f4\u5feb\uff0c\u5bf9\u5427\uff1f\u201d\u7136\u800c\uff0c\u7ed3\u8bba\u662f\u9519\u8bef\u7684\u3002<\/p>\n<p>\u4ed4\u7ec6\u601d\u8003\u540e\uff0c\u542f\u7528AOT\u8bbe\u7f6e&#8221; aot: true &#8220;\u53ea\u662f\u5bf9build\u547d\u4ee4\u63d0\u4f9b\u7684\u9009\u9879\u7684\u4e00\u90e8\u5206\u3002<br \/>\n\u987a\u5e26\u4e00\u63d0\uff0carchitect\u662f\u6307Angular CLI\u4e2d\u4e0eserve\u548ctest\u7b49\u6784\u5efa\u547d\u4ee4\u76f8\u5173\u7684\u5b9e\u4f53\uff0c\u5b83\u4ee3\u8868\u4e86\u4e00\u7cfb\u5217\u6240\u8c13\u7684\u201c\u4efb\u52a1\u201d\uff08\u800c\u811a\u624b\u67b6\u751f\u6210\u547d\u4ee4\u7684\u5b9e\u4f53\u5219\u79f0\u4e3aschematics\uff09\u3002<\/p>\n<p>\u5173\u4e8eng test\u7684\u4e8b\u60c5\uff0c\u6709\u4e00\u4e2a\u540d\u4e3akarma\u7684\u6784\u5efa\u4f53\u5728\u8fd0\u884c\u3002\u5728angular.json\u6587\u4ef6\u4e2d\uff0c\u5b83\u662f\u5728test\u952e\u4e0b\u8fdb\u884c\u914d\u7f6e\u7684\u3002aot: true\u5bf9karma\u6784\u5efa\u4f53\u7684\u914d\u7f6e\u6ca1\u6709\u4efb\u4f55\u5f71\u54cd\uff0c\u56e0\u6b64\u5373\u4f7f\u542f\u7528\u4e86Ivy\uff08\u5305\u62ecAngular CLI 9.x\uff09\uff0c\u76ee\u524d\u4ecd\u7136\u4f1a\u5728Karma\u4e2d\u7ee7\u7eed\u4f7f\u7528JiT\u7f16\u8bd1\u3002<\/p>\n<h3>\u95ee\uff1a\u4e3a\u4ec0\u4e48\u4ec5\u4ec5\u8bbe\u7f6eenableIvy\u4e3atrue\u5c31\u65e0\u6cd5\u52a0\u5feb\u901f\u5ea6\uff1f<br \/>\n\u7b54\uff1a\u56e0\u4e3aJiT\u7684\u5b9e\u73b0\u5b8c\u5168\u4e0d\u540c\u3002<\/h3>\n<p>\u6240\u4ee5\uff0c\u8fd9\u6b21\u7684\u52a0\u901f\u5207\u6362\u53ea\u662f\u5728tsconfig.json\u4e2d\u5199\u5165\u201cenableIvy: true\u201d\u7684\u90e8\u5206\u3002\u8fd9\u610f\u5473\u7740\u5207\u6362\u4eceView Engine\uff08Render 2\uff09\u5230Ivy\uff08Render 3\uff09\u3002<\/p>\n<p>\u8fd9\u4e2a\u540d\u4e3a enableIvy \u7684\u9009\u9879\u4e0d\u4ec5\u6539\u53d8\u4e86 Angular Core \u7684 View Engine\uff0c\u8fd8\u6539\u53d8\u4e86 TestBed \u5b9e\u4f53\u4ee5\u53ca\u4e0e TestBed \u76f8\u5173\u7684 Testing Compiler \u7684\u5b9e\u73b0\uff0c\u5206\u522b\u88ab Ivy \u6240\u4e13\u7528\u7684\u5b9e\u73b0 TestBedRender3 \u548c R3TestBedCompiler \u6240\u66ff\u4ee3\u3002\u5c3d\u7ba1\u4f7f\u7528\u4e86 TestBed.configureTestingModule \u8fd9\u6837\u7684\u8bed\u6cd5\uff0c\u5b9e\u73b0\u5374\u5728\u4e0d\u77e5\u4e0d\u89c9\u4e2d\u88ab\u66ff\u6362\u4e86\u3002\u4e2a\u4eba\u800c\u8a00\uff0c\u8fd9\u8ba9\u6211\u6709\u4e00\u79cd\u300c\u9759\u6001\u65b9\u6cd5\u662f\u4ec0\u4e48\u5462\u2026\u2026\u300d\u7684\u611f\u89c9\uff0c\u4f46\u662f\u53ea\u8981\u5728 tsconfig.json \u4e2d\u5199\u5165 enableIvy\uff0c\u5c31\u53ef\u4ee5\u5728 ts \u7f16\u8bd1\u5668 ngc \u7684\u9636\u6bb5\u505a\u4efb\u4f55\u4e8b\u60c5\uff0c\u6240\u4ee5\u4e0d\u80fd\u53ea\u56e0\u4e3a\u662f\u9759\u6001\u65b9\u6cd5\u5c31\u4e00\u5b9a\u6709\u76f8\u540c\u7684\u5b9e\u73b0\uff0c\u8fd9\u5c31\u662f\u8fd9\u4e2a\u95ee\u9898\u7684\u8ba8\u8bba\u5185\u5bb9\u3002<\/p>\n<p>\u95f2\u8bdd\u4f11\u9898\u3002\u73b0\u5728\uff0cIvy\u4e13\u7528\u7684\u6d4b\u8bd5\u7f16\u8bd1\u5668 R3TestBedCompiler \u5c06\u5b9e\u9645\u7684\u7ec4\u4ef6\u7f16\u8bd1\u5de5\u4f5c\u59d4\u6258\u7ed9 Angular Core \u7684 Ivy \u7528 JiT \u7f16\u8bd1\u5668\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">Render 2\u306e\u5834\u5408\uff1aTestBed.configureTestingModule(&#8230;).compileComponents() \u306e\u6642\u70b9\u3067JiT\u30b3\u30f3\u30d1\u30a4\u30eb\u304c\u52d5\u4f5c\u3057\u3001spec\u3067\u5fc5\u8981\u3068\u306a\u308bModule\u3084Component\u306e\u30b3\u30f3\u30d1\u30a4\u30eb\u304c\u5b9f\u884c\u3055\u308c\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">Ivy(Render 3)\u306e\u5834\u5408\uff1aTestBed.configureTestingModule(&#8230;).compileComponents() \u306fAngular Core Ivy JiT\u30b3\u30f3\u30d1\u30a4\u30e9\u3078\u3001Module\u3092\u30ad\u30e5\u30fc\u30a4\u30f3\u30b0\u3059\u308b\u3060\u3051\u3002\u305d\u306e\u5f8c\u3001\u30ad\u30e5\u30fc\u306b\u5165\u308c\u3089\u305fModule\u5b9a\u7fa9\u306b\u3057\u305f\u304c\u3063\u3066\u3001JiT\u30b3\u30f3\u30d1\u30a4\u30e9\u304cModule\u3084Component\u306e\u30b3\u30f3\u30d1\u30a4\u30eb\u3092\u5b9f\u884c\u3059\u308b<\/ul>\n<p>\u65e0\u8bba\u662f\u5728Render 2\u8fd8\u662f\u5728Ivy\u4e2d\uff0c\u5904\u7406\u6d41\u7a0b\u672c\u8d28\u4e0a\u51e0\u4e4e\u662f\u4e00\u6837\u7684\uff0c\u4f46Ivy\u7684\u5173\u952e\u4e4b\u5904\u5728\u4e8e\u5b83\u7ecf\u5386\u4e86\u4e00\u4e2a\u53eb\u505a&#8221;\u6a21\u5757\u5b9a\u4e49\u4fe1\u606f\u6392\u961f&#8221;\u7684\u6b65\u9aa4\u3002Ivy\u7684JiT\u7f16\u8bd1\u5668\u5728\u4ece\u961f\u5217\u4e2d\u53d6\u51fa\u5e76\u6267\u884c\u7f16\u8bd1\u65f6\uff0c\u5b9e\u73b0\u4e86&#8221;\u8df3\u8fc7\u5df2\u7f16\u8bd1\u7684\u6a21\u5757&#8221;\u7684\u529f\u80fd\u3002<\/p>\n<p>\u56e0\u6b64\uff0c\u65e0\u8bbaspec\u7684\u6570\u91cf\u662f\u591a\u5c11\uff0c\u53ea\u8981\u5728imports\u4e2d\u5217\u51fa\u7684Module\u4ec5\u6267\u884c\u4e00\u6b21JiT\u7f16\u8bd1\uff0c\u5c31\u4f1a\u53d8\u5f97\u66f4\u5feb\u3002\u8fd9\u5c31\u662f\u7f13\u5b58\u6216\u8005\u98de\u884c\u91cd\u91cf\u6a21\u5f0f\u7684\u539f\u7406\u3002<\/p>\n<h3>\u7f13\u5b58\u548c\u6d4b\u8bd5\u7f16\u8bd1\u5668<\/h3>\n<p>\u4e0e\u5728\u6d4f\u89c8\u5668\u4e2d\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f\u4e0d\u540c\u7684\u662f\uff0c\u6d4b\u8bd5\u7f16\u8bd1\u5668\u4e2d\u7684\u9ebb\u70e6\u4e4b\u5904\u5728\u4e8e\u9700\u8981\u63d0\u4f9b\u8986\u76d6\u6a21\u5757\u548c\u8986\u76d6\u7ec4\u4ef6\u7b49\u529f\u80fd\uff0c\u4ee5\u4fbf\u4e3a\u6d4b\u8bd5\u76ee\u7684\u5b58\u6839\u5316\u6216\u91cd\u5199\u7279\u5b9a\u7684\u4f9d\u8d56\u5173\u7cfb\u3002\u4f7f\u7528\u8fd9\u4e9b\u529f\u80fd\u5c06\u521b\u5efa\u4e00\u4e2a\u60c5\u51b5\uff0c\u5373\u201c\u5373\u4f7f\u662f\u540c\u540d\u7684\u6a21\u5757\uff0c\u5728\u6bcf\u4e2a\u89c4\u8303\u4e2d\u5b9e\u4f53\u4e5f\u662f\u4e0d\u540c\u7684\u201d\uff0c\u56e0\u6b64\u4e0e\u672c\u6b21\u7f13\u5b58\u4f18\u5316\u975e\u5e38\u4e0d\u517c\u5bb9\u3002\u5728Ivy\u7684\u60c5\u51b5\u4e0b\uff0c\u901a\u8fc7\u5728R3TestBedCompiler\u4e2d\u5c06JiT\u7f16\u8bd1\u5668\u5165\u961f\u65f6\u7a0d\u5fae\u66f4\u6539\u952e\u6765\u907f\u514d\u8fd9\u79cd\u60c5\u51b5\u3002<\/p>\n<p>\u5728 Angular 2 \u6216 4 \u7248\u672c\u65f6\uff0c\u6211\u66fe\u7ecf\u505a\u8fc7\u7c7b\u4f3c\u7684\u4e8b\u60c5\uff0c\u5373\u901a\u8fc7JiT\u7f16\u8bd1\u5668\u6765\u7f13\u5b58Karma\u7684\u7ed3\u679c\u4ee5\u63d0\u9ad8\u6027\u80fd\u3002<\/p>\n<p>\u7531\u4e8eAngular\u662f\u4e3a\u4e86\u5141\u8bb8\u5728TestBed\u4e0a\u8fdb\u884c\u7f16\u8bd1\u5668\u7684\u4f9d\u8d56\u6ce8\u5165\u800c\u8bbe\u8ba1\u7684\uff0c\u6240\u4ee5\u6211\u4eec\u901a\u8fc7\u4f7f\u7528Flyweight\u6a21\u5f0f\u5f3a\u884c\u5c01\u88c5\u4e86Render 2\u7684JiT\u7f16\u8bd1\u5668\uff0c\u5e76\u6dfb\u52a0\u4e86\u7f13\u5b58\u3002<\/p>\n<p>\u6b63\u5982\u4e4b\u524d\u63d0\u5230\u7684\uff0cIvy\u81ea\u5e26\u4e86JiT\u7f16\u8bd1\u5668\u81ea\u8eab\u7684\u7f13\u5b58\u7ba1\u7406\u529f\u80fd\uff0c\u8fd9\u5f88\u597d\u3002\u4f46\u662fRender 2\u7684JiT\u7f16\u8bd1\u5668\u672c\u8eab\u5e76\u6ca1\u6709\u90a3\u4e48\u591a\u529f\u80fd\uff0c\u6240\u4ee5\u6211\u8bb0\u5f97\u5f53\u65f6\u81ea\u5df1\u5199\u4e86\u4e00\u4e2a\u975e\u5e38\u5371\u9669\u7684\u5b9e\u73b0\uff08\u4ece\u8fd9\u4e2a\u610f\u4e49\u4e0a\u8bf4\uff0c\u5bf9\u4e8e\u6b64\u6b21\u901a\u8fc7Ivy\u52a0\u901f\u6d4b\u8bd5\u7684\u4e8b\u60c5\uff0c\u6211\u6709\u4e9b\u81ea\u4ee5\u4e3a\u4e0a\u5929\u7684\u611f\u89c9\uff0c\u89c9\u5f97\u7ec8\u4e8e\u8d76\u4e0a\u65f6\u4ee3\u4e86\uff09\u3002<\/p>\n<h2>\u5728Ivy\u4e0a\u5355\u5143\u6d4b\u8bd5\u52a0\u901f\u7684\u5de5\u4f5c\u91cf\u4e4b\u524d<\/h2>\n<p>\u5373\u4f7f\u6ca1\u6709\u542f\u7528Ivy\uff0c\u4eceAngular 5.x\u5f00\u59cb\u5c31\u63d0\u4f9b\u4e86\u52a0\u901f\u7684\u65b9\u6cd5\u3002<\/p>\n<p>\u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528Angular CLI\u751f\u6210\u7684\u9879\u76ee\uff0csrc\/test.ts\u5e94\u8be5\u5982\u4e0b\u6240\u793a\u3002<\/p>\n<pre class=\"post-pre\"><code>\r\n<span class=\"c1\">\/\/ First, initialize the Angular testing environment.<\/span>\r\n<span class=\"nx\">getTestBed<\/span><span class=\"p\">().<\/span><span class=\"nx\">initTestEnvironment<\/span><span class=\"p\">(<\/span>\r\n  <span class=\"nx\">BrowserDynamicTestingModule<\/span><span class=\"p\">,<\/span>\r\n  <span class=\"nx\">platformBrowserDynamicTesting<\/span><span class=\"p\">()<\/span>\r\n<span class=\"p\">);<\/span>\r\n<\/code><\/pre>\n<p>\u5b9e\u9645\u4e0a\uff0c\u51fd\u6570 initTestEnvironment \u73b0\u5728\u53ef\u4ee5\u63a5\u53d7\u4e00\u4e2a\u540d\u4e3aaotSummaries\u7684\u6570\u7ec4\u4f5c\u4e3a\u7b2c3\u4e2a\u53c2\u6570\u3002\u6839\u636e\u524d\u7f00aot\u53ef\u4ee5\u63a8\u65ad\u51fa\uff0c\u53ef\u4ee5\u901a\u8fc7\u5c06\u4f8b\u5982app.module.ngsummary.json\u7b49\u88abAoT\u7f16\u8bd1\uff08ngc\u547d\u4ee4\uff09\u7684\u6210\u679c\u6587\u4ef6\u7684\u5185\u5bb9\u4f20\u9012\u7ed9\u5b83\u6765\u4f7f\u5176\u5de5\u4f5c\u3002<\/p>\n<p>\u6211\u65b9\u6240\u8ff0\u7684\u5185\u5bb9<\/p>\n<blockquote><p>\u5728Ivy\u4e2d\uff0ccompileModuleAndAllComponentsAsync\u662f\u6d4b\u8bd5\u7684\u74f6\u9888\uff0c\u5b83\u662f\u6267\u884cJiT\u7f16\u8bd1\u7684\u51fd\u6570\uff0c\u6240\u4ee5\u6211\u8ba4\u4e3a\uff1a\u201c\u5982\u679c\u5728Karma\u6d4b\u8bd5\u4e2d\u542f\u7528AoT\uff0c\u90a3\u4e48\u5c31\u4e0d\u4f1a\u8fdb\u884c\u8fd0\u884c\u65f6\u7f16\u8bd1\uff0c\u4f1a\u53d8\u5feb\u3002\u201d<\/p><\/blockquote>\n<p>\u8fd9\u662f\u4e00\u79cd\u52a0\u5feb\u901f\u5ea6\u7684\u6a21\u5f0f\u3002<\/p>\n<p>\u4e3a\u4ec0\u4e48\u9700\u8981 *.ngsummary.json\uff1f\u56e0\u4e3a\u5728Render 2\u4e2d\uff0c\u901a\u8fc7AoT\u7f16\u8bd1\u65f6\uff0c\u9664\u4e86\u751f\u6210app.component.js\u4e4b\u5916\uff0c\u8fd8\u4f1a\u751f\u6210\u4e0b\u9762\u7684\u6587\u4ef6\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">app.component.ngfactory.js: \u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u6210\u308c\u306e\u679c\u3066<\/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\">app.component.css.shim.ngstyle.js: CSS\u306e\u6210\u308c\u306e\u679c\u3066<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">app.component.metadata.json: \u30c7\u30b3\u30ec\u30fc\u30bf\u60c5\u5831\u306e\u6210\u308c\u306e\u679c\u3066<\/ul>\n<p>\u95ee\u9898\u662f\uff0capp.component.js\u6587\u4ef6\u4e2d\u7f3a\u5c11\u5bf9\u4e0a\u8ff0AoT\u6210\u679c\u7269\u7684\u5f15\u7528\u3002<\/p>\n<p>\u56e0\u6b64\uff0c\u5373\u4f7f\u8bbe\u7f6e\u4e86\u5982\u4e0b\u7684TestBed\uff0c\u4e5f\u65e0\u6cd5\u77e5\u9053\u8d1f\u8d23DOM\u64cd\u4f5c\u7684ngfactory\u4f4d\u4e8e\u4f55\u5904\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nx\">beforeEach<\/span><span class=\"p\">(()<\/span> <span class=\"o\">=&gt;<\/span> <span class=\"p\">{<\/span>\r\n  <span class=\"nx\">TestBed<\/span><span class=\"p\">.<\/span><span class=\"nx\">configureTestingModule<\/span><span class=\"p\">({<\/span>\r\n    <span class=\"na\">declarations<\/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=\"p\">});<\/span>\r\n<\/code><\/pre>\n<p>\u4e3a\u4e86\u5411TestBed\u4f20\u8fbeAoT\u7684\u7ed3\u679c\uff0c\u6211\u4eec\u9700\u8981\u63d0\u4f9b\u7c7b\u4f3c\u4e8e\u201c\u8fd9\u91cc\u662fAppComponent\u7684ngfactory\u201d\u7684\u6458\u8981\u4fe1\u606f\u3002.ngsummary.json\u5c31\u627f\u62c5\u4e86\u8fd9\u4e2a\u8d23\u4efb\u3002<\/p>\n<p>\u6b64\u5916\uff0c\u7531\u4e8eAoT\u548cKarma\u88ab\u4ee5Angular CLI\u7684\u5f62\u5f0f\u63a7\u5236\uff0c\u56e0\u6b64\u8981\u5728Karma\u4e2d\u5b9e\u9645\u4f7f\u7528aotSummaries\uff0c\u53ea\u80fd\u9009\u62e9\u81ea\u5df1\u52aa\u529b\u89e3\u51b3\u6216\u8005\u66f4\u6539architect\uff0c\u8fd9\u662f\u552f\u4e00\u7684\u9009\u62e9\u3002<\/p>\n<p>\u6211\u8ba4\u4e3a\uff0c\u4eceAngular 9\u5f00\u59cb\uff0caotSummaries\u9009\u9879\u53ef\u80fd\u4f1a\u88ab\u5e9f\u5f03\u3002\u56e0\u4e3a\u5728Ivy\u4e2d\uff0capp.component.html\u548capp.component.css\u7684\u4fe1\u606f\u4e5f\u4f1a\u88ab\u5b8c\u5168\u7f16\u8bd1\u6210app.component.js\uff0c\u6240\u4ee5ngsummary.json\u6587\u4ef6\u672c\u8eab\u4e0d\u4f1a\u88ab\u8f93\u51fa\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u5c31\u5355\u5143\u6d4b\u8bd5\u52a0\u901f\u7684\u89d2\u5ea6\u6765\u8bf4\uff0c\u6b63\u5982\u4e4b\u524d\u6240\u8ff0\uff0cIvy\u5373\u4f7f\u4f7f\u7528JiT\uff0c\u901f\u5ea6\u4e5f\u8db3\u591f\u5feb\uff0c\u6ca1\u6709\u5fc5\u8981\u989d\u5916\u4f7f\u7528AoT\u6765\u8fd0\u884cKarma\u3002<\/p>\n<p>\u4e8b\u5b9e\u4e0a\uff0c\u6211\u8bd5\u7740\u5728Karma\u7684\u67b6\u6784\u4e2d\u4f7f\u7528AoT\u8fdb\u884c\u6539\u5199\uff0c\u4f46\u5728\u6267\u884c\u65f6\u95f4\u4e0a\u5e76\u6ca1\u6709\u663e\u8457\u7684\u5dee\u5f02\u3002\u76f8\u53cd\uff0c\u6539\u5199\u67b6\u6784\u5728\u4e00\u79d2\u5185\u5c31\u5b8c\u6210\u4e86\uff0c\u5e76\u4e14\u8ba9\u6211\u66f4\u52a0\u4f53\u9a8c\u5230\u4e86Ivy\u7684AoT\u7f16\u8bd1\u6d41\u7a0b\u7684\u7b80\u6d01\u6027\uff0c\u8fd9\u662f\u6700\u5f15\u4eba\u6ce8\u76ee\u7684\u4eae\u70b9\u3002<\/p>\n<h2>\u6700\u540e<\/h2>\n<p>\u5c3d\u7ba1\u6211\u5199\u5f97\u6709\u70b9\u5570\u55e6\uff0c\u4f46\u662f\u8fd9\u7bc7\u6587\u7ae0\u7684\u7ed3\u8bba\u662f\u201c\u65e0\u8bba\u662fJIT\u8fd8\u662fAOT\uff0c\u53ea\u8981\u542f\u7528Ivy\uff0c\u5355\u5143\u6d4b\u8bd5\u90fd\u4f1a\u53d8\u5f97\u66f4\u5feb\u201d\u3002<\/p>\n<p>\u660e\u5929\u662f@nao_y\u5148\u751f\uff01<\/p>\n<div>\n<p>\u4eceAngular 4.x\u5f00\u59cb\uff0c\u8fd9\u4e2a\u95ee\u9898\u4e00\u76f4\u56f0\u6270\u7740\u6211\u3002\u6211\u5728https:\/\/medium.com\/@Quramy\/performance-angular-unit-testing-9ce30ae83e7\u7b49\u5730\u4e5f\u5199\u8fc7\u76f8\u5173\u5185\u5bb9\u3002\u21a9<\/p>\n<p>\u5728https:\/\/github.com\/angular\/angular\/blob\/8.2.14\/packages\/core\/src\/render3\/jit\/module.ts#L49-L66\u9644\u8fd1\u3002\u21a9<\/p>\n<p>https:\/\/angular.io\/api\/core\/testing\/TestBed#inittestenvironment\u21a9<\/p>\n<p>\u987a\u4fbf\u8bf4\u4e00\u4e0b\uff0c\u6211\u66fe\u7ecf\u4e3aKarma\u7684architect\u63d0\u4ea4\u4e86\u4e00\u4e2a\u53ef\u4ee5\u5904\u7406aotSummaries\u7684PR\uff0c\u4f46\u7531\u4e8e\u201c\u5b9e\u9a8c\u6027\u592a\u5f3a\uff0c\u8fd8\u6709\u7f16\u8bd1\u5668\u7684\u8003\u8651\u201d\uff0c\u8fd9\u4e2aPR\u88ab\u62d2\u7edd\u4e86\u3002\u73b0\u5728\u56de\u60f3\u8d77\u6765\uff0c\u53ef\u80fd\u5df2\u7ecf\u5728\u8003\u8651Render 3\u4e86\u3002\u21a9<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u5e74\u7684Angular AdoCare\u5bf9\u4e8e\u6d4b\u8bd5\u7684\u8ba8\u8bba\u975e\u5e38\u4e30\u5bcc\u3002\u6bd4\u5982\u8bf4Angular8\u5355\u5143\u6d4b\u8bd5\u6709\u95ee\u9898\u554a\uff01\u8fd8\u6709\u5728\u5199\u7b2c [&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-39400","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>Ivy\u7ed9\u5355\u5143\u6d4b\u8bd5\u5e26\u6765\u7684\u597d\u5904 - 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\/ivy\u7ed9\u5355\u5143\u6d4b\u8bd5\u5e26\u6765\u7684\u597d\u5904\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ivy\u7ed9\u5355\u5143\u6d4b\u8bd5\u5e26\u6765\u7684\u597d\u5904\" \/>\n<meta property=\"og:description\" content=\"\u4eca\u5e74\u7684Angular AdoCare\u5bf9\u4e8e\u6d4b\u8bd5\u7684\u8ba8\u8bba\u975e\u5e38\u4e30\u5bcc\u3002\u6bd4\u5982\u8bf4Angular8\u5355\u5143\u6d4b\u8bd5\u6709\u95ee\u9898\u554a\uff01\u8fd8\u6709\u5728\u5199\u7b2c [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/ivy\u7ed9\u5355\u5143\u6d4b\u8bd5\u5e26\u6765\u7684\u597d\u5904\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-09-21T00:38:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-29T23:34:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d3a0837434c4406c7c40d\/8-0.png\" \/>\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=\"2 \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\/ivy%e7%bb%99%e5%8d%95%e5%85%83%e6%b5%8b%e8%af%95%e5%b8%a6%e6%9d%a5%e7%9a%84%e5%a5%bd%e5%a4%84\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/ivy%e7%bb%99%e5%8d%95%e5%85%83%e6%b5%8b%e8%af%95%e5%b8%a6%e6%9d%a5%e7%9a%84%e5%a5%bd%e5%a4%84\/\",\"name\":\"Ivy\u7ed9\u5355\u5143\u6d4b\u8bd5\u5e26\u6765\u7684\u597d\u5904 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-09-21T00:38:02+00:00\",\"dateModified\":\"2024-04-29T23:34:38+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/ivy%e7%bb%99%e5%8d%95%e5%85%83%e6%b5%8b%e8%af%95%e5%b8%a6%e6%9d%a5%e7%9a%84%e5%a5%bd%e5%a4%84\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/ivy%e7%bb%99%e5%8d%95%e5%85%83%e6%b5%8b%e8%af%95%e5%b8%a6%e6%9d%a5%e7%9a%84%e5%a5%bd%e5%a4%84\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/ivy%e7%bb%99%e5%8d%95%e5%85%83%e6%b5%8b%e8%af%95%e5%b8%a6%e6%9d%a5%e7%9a%84%e5%a5%bd%e5%a4%84\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ivy\u7ed9\u5355\u5143\u6d4b\u8bd5\u5e26\u6765\u7684\u597d\u5904\"}]},{\"@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\/ivy%e7%bb%99%e5%8d%95%e5%85%83%e6%b5%8b%e8%af%95%e5%b8%a6%e6%9d%a5%e7%9a%84%e5%a5%bd%e5%a4%84\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Ivy\u7ed9\u5355\u5143\u6d4b\u8bd5\u5e26\u6765\u7684\u597d\u5904 - 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\/ivy\u7ed9\u5355\u5143\u6d4b\u8bd5\u5e26\u6765\u7684\u597d\u5904\/","og_locale":"zh_CN","og_type":"article","og_title":"Ivy\u7ed9\u5355\u5143\u6d4b\u8bd5\u5e26\u6765\u7684\u597d\u5904","og_description":"\u4eca\u5e74\u7684Angular AdoCare\u5bf9\u4e8e\u6d4b\u8bd5\u7684\u8ba8\u8bba\u975e\u5e38\u4e30\u5bcc\u3002\u6bd4\u5982\u8bf4Angular8\u5355\u5143\u6d4b\u8bd5\u6709\u95ee\u9898\u554a\uff01\u8fd8\u6709\u5728\u5199\u7b2c [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/ivy\u7ed9\u5355\u5143\u6d4b\u8bd5\u5e26\u6765\u7684\u597d\u5904\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-09-21T00:38:02+00:00","article_modified_time":"2024-04-29T23:34:38+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d3a0837434c4406c7c40d\/8-0.png"}],"author":"\u96c5, \u609f","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u96c5, \u609f","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/ivy%e7%bb%99%e5%8d%95%e5%85%83%e6%b5%8b%e8%af%95%e5%b8%a6%e6%9d%a5%e7%9a%84%e5%a5%bd%e5%a4%84\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/ivy%e7%bb%99%e5%8d%95%e5%85%83%e6%b5%8b%e8%af%95%e5%b8%a6%e6%9d%a5%e7%9a%84%e5%a5%bd%e5%a4%84\/","name":"Ivy\u7ed9\u5355\u5143\u6d4b\u8bd5\u5e26\u6765\u7684\u597d\u5904 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-09-21T00:38:02+00:00","dateModified":"2024-04-29T23:34:38+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/ivy%e7%bb%99%e5%8d%95%e5%85%83%e6%b5%8b%e8%af%95%e5%b8%a6%e6%9d%a5%e7%9a%84%e5%a5%bd%e5%a4%84\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/ivy%e7%bb%99%e5%8d%95%e5%85%83%e6%b5%8b%e8%af%95%e5%b8%a6%e6%9d%a5%e7%9a%84%e5%a5%bd%e5%a4%84\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/ivy%e7%bb%99%e5%8d%95%e5%85%83%e6%b5%8b%e8%af%95%e5%b8%a6%e6%9d%a5%e7%9a%84%e5%a5%bd%e5%a4%84\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"Ivy\u7ed9\u5355\u5143\u6d4b\u8bd5\u5e26\u6765\u7684\u597d\u5904"}]},{"@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\/ivy%e7%bb%99%e5%8d%95%e5%85%83%e6%b5%8b%e8%af%95%e5%b8%a6%e6%9d%a5%e7%9a%84%e5%a5%bd%e5%a4%84\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/39400","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=39400"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/39400\/revisions"}],"predecessor-version":[{"id":90563,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/39400\/revisions\/90563"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=39400"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=39400"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=39400"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}