This repository was archived by the owner on Aug 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path18-es2015.9da013ce9d5a697c1c1c.js
More file actions
1 lines (1 loc) · 28.1 KB
/
18-es2015.9da013ce9d5a697c1c1c.js
File metadata and controls
1 lines (1 loc) · 28.1 KB
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[18],{RTYZ:function(e,o,t){"use strict";t.r(o);var a=t("8Y7J"),d=t("0qEG");class c{constructor(){this.item={cols:1,urls:{"en-US":"packages/mock/docs/getting-started.en-US.md","zh-CN":"packages/mock/docs/getting-started.zh-CN.md"},content:{"en-US":{content:'<section class="markdown"><article><h2 id="Foreword">Foreword<a onclick="window.location.hash = \'Foreword\'" class="anchor">#</a></h2><p><code>@delon/mock</code> is a simulation data generator to help the front-end to develop and prototype separate from the back-end progress and reduce some monotony particularly while writing automated tests.</p><p><strong>Features</strong></p><ul><li><p>All of the Angular projects</p></li><li><p>Unobtrusive</p></li><li><p>Simple usage</p></li><li><p>Support <a target="_blank" href="http://mockjs.com/" data-url="http://mockjs.com/">mock.js</a></p></li></ul><h2 id="Usage">Usage<a onclick="window.location.hash = \'Usage\'" class="anchor">#</a></h2><p>Install <code>@delon/mock</code> from <code>yarn</code>.</p><pre class="hljs language-bash"><code>yarn add @delon/mock -D</code></pre><p>Import the <a href="/mock/rule" data-url="/mock/rule">mock rule data</a> and <code>DelonMockModule</code> in to your root <code>AppModule</code>.</p><pre class="hljs language-ts"><code>import { DelonMockModule } from \'@delon/mock\';\nimport * as MOCKDATA from \'../../_mock\';\n// Configuration for test environment only.\nimport { environment } from \'../environments/environment\';\nconst MOCKMODULE = !environment.production ? [ DelonMockModule.forRoot({ data: MOCKDATA }) ] : [];\n\n@NgModule({\n imports: [\n ...MOCKMODULE\n ]\n})</code></pre><h3 id="MockOptions">MockOptions<a onclick="window.location.hash = \'MockOptions\'" class="anchor">#</a></h3><p>The <code>forRoot</code> parameters:</p><table><thead><tr><th>Property</th><th>Type</th><th>Default</th><th>Description</th></tr></thead><tbody><tr><td><code>[data]</code></td><td><code>any</code></td><td>-</td><td>Mock data rule</td></tr><tr><td><code>[delay]</code></td><td><code>number</code></td><td><code>300</code></td><td>Request delay, unit is milliseconds</td></tr><tr><td><code>[force]</code></td><td><code>boolean</code></td><td><code>false</code></td><td>Whether to force all requests to Mock, <code>true</code> means to return a 404 error directly when the requested URL does not exist, <code>false</code> means to send a real HTTP request when the request is missed</td></tr><tr><td><code>[log]</code></td><td><code>boolean</code></td><td><code>true</code></td><td>Whether to print Mock request information, make up for the browser without Network information; it will output <span>\u{1f47d}Mock</span> when hit</td></tr><tr><td><code>[executeOtherInterceptors]</code></td><td><code>boolean</code></td><td><code>true</code></td><td>Whether continue to call other interceptor <code>intercept</code> method after mock rule hit</td></tr></tbody></table><blockquote><p><strong>Lazy modules</strong> need to import <code>forChild</code>, You can import <code>forChild</code> in the <code>SharedModule</code>.</p></blockquote></article></section>',meta:{order:1,title:"Getting Started",type:"Documents"},toc:[{id:"Foreword",title:"Foreword",h:2},{id:"Usage",title:"Usage",h:2},{id:"MockOptions",title:"MockOptions",h:3}]},"zh-CN":{content:'<section class="markdown"><article><h2 id="\u5199\u5728\u524d\u9762">\u5199\u5728\u524d\u9762<a onclick="window.location.hash = \'\u5199\u5728\u524d\u9762\'" class="anchor">#</a></h2><p>Mock \u662f\u6307\u901a\u8fc7\u751f\u6210\u6a21\u62df\u6570\u636e\u8ba9\u524d\u7aef\u5f00\u53d1\u4eba\u5458\u72ec\u7acb\u4e8e\u540e\u7aef\u8fdb\u884c\u5f00\u53d1\uff0c\u6709\u65f6\u6211\u4eec\u4e5f\u4f1a\u8fd0\u7528\u5728\u6d4b\u8bd5\u73af\u5883\u4e2d\u3002</p><p><code>@delon/mock</code> \u662f\u4e00\u4e2a\u7b80\u5355 Mock \u529f\u80fd\uff0c\u5305\u62ec\u4ee5\u4e0b\u51e0\u4e2a\u7279\u5f81\uff1a</p><ul><li><p>\u4efb\u610f Angular \u9879\u76ee</p></li><li><p>\u5f00\u53d1\u65e0\u4fb5\u5165</p></li><li><p>\u8d85\u7b80\u5355\u7528\u6cd5</p></li><li><p>\u652f\u6301 <a target="_blank" href="http://mockjs.com/" data-url="http://mockjs.com/">mock.js</a></p></li></ul><h2 id="\u5982\u4f55\u4f7f\u7528">\u5982\u4f55\u4f7f\u7528<a onclick="window.location.hash = \'\u5982\u4f55\u4f7f\u7528\'" class="anchor">#</a></h2><p>\u5b89\u88c5 <code>@delon/mock</code> \u4f9d\u8d56\u5305\uff1a</p><pre class="hljs language-bash"><code>yarn add @delon/mock -D</code></pre><p>\u5728\u6839\u6a21\u5757 <code>AppModule</code> \u5bfc\u5165 <a href="/mock/rule" data-url="/mock/rule">Mock \u89c4\u5219\u6570\u636e</a>\u548c <code>DelonMockModule</code>\uff1b</p><pre class="hljs language-ts"><code>import { DelonMockModule } from \'@delon/mock\';\nimport * as MOCKDATA from \'../../_mock\';\n// \u53ea\u5bf9\u5f00\u53d1\u73af\u5883\u6709\u6548\nimport { environment } from \'../environments/environment\';\nconst MOCKMODULE = !environment.production ? [ DelonMockModule.forRoot({ data: MOCKDATA }) ] : [];\n\n@NgModule({\n imports: [\n ...MOCKMODULE\n ]\n})</code></pre><h3 id="MockOptions-\u914d\u7f6e">MockOptions \u914d\u7f6e<a onclick="window.location.hash = \'MockOptions-\u914d\u7f6e\'" class="anchor">#</a></h3><p><code>forRoot</code> \u53c2\u6570\u8fd8\u5305\u62ec\uff1a</p><table><thead><tr><th>\u53c2\u6570\u540d</th><th>\u7c7b\u578b</th><th>\u9ed8\u8ba4\u503c</th><th>\u63cf\u8ff0</th></tr></thead><tbody><tr><td><code>[data]</code></td><td><code>any</code></td><td>-</td><td>Mock \u6570\u636e\u89c4\u5219</td></tr><tr><td><code>[delay]</code></td><td><code>number</code></td><td><code>300</code></td><td>\u8bf7\u6c42\u5ef6\u8fdf\uff0c\u5355\u4f4d\uff1a\u6beb\u79d2</td></tr><tr><td><code>[force]</code></td><td><code>boolean</code></td><td><code>false</code></td><td>\u662f\u5426\u5f3a\u5236\u6240\u6709\u8bf7\u6c42\u90fdMock\uff0c<code>true</code> \u8868\u793a\u5f53\u8bf7\u6c42\u7684URL\u4e0d\u5b58\u5728\u65f6\u76f4\u63a5\u8fd4\u56de 404 \u9519\u8bef\uff0c<code>false</code> \u8868\u793a\u672a\u547d\u4e2d\u65f6\u53d1\u9001\u771f\u5b9eHTTP\u8bf7\u6c42</td></tr><tr><td><code>[log]</code></td><td><code>boolean</code></td><td><code>true</code></td><td>\u662f\u5426\u6253\u5370 Mock \u8bf7\u6c42\u4fe1\u606f\uff0c\u5f25\u8865\u6d4f\u89c8\u5668\u65e0Network\u4fe1\u606f\uff1b\u5f53\u8bf7\u6c42\u7ecf\u8fc7 Mock \u4f1a\u63a5\u6536\u3010\u{1f47d}Mock\u3011</td></tr><tr><td><code>[executeOtherInterceptors]</code></td><td><code>boolean</code></td><td><code>true</code></td><td>\u662f\u5426\u62e6\u622a\u547d\u4e2d\u540e\u7ee7\u7eed\u8c03\u7528\u540e\u7eed\u62e6\u622a\u5668\u7684 <code>intercept</code> \u65b9\u6cd5</td></tr></tbody></table><blockquote><p>\u82e5<strong>\u61d2\u6a21\u5757</strong>\u8fd8\u9700\u8981\u5bfc\u5165 <code>forChild</code> \u786e\u4fddHTTP\u62e6\u622a\u5668\u6709\u6548\uff0c\u4e00\u822c\u53ef\u4ee5\u76f4\u63a5\u5728 SharedModule \u76f4\u63a5\u4f7f\u7528 <code>forChild</code>\u3002</p></blockquote><h3 id="\u4e3a\u4ec0\u4e48\u53ea\u5bf9\u5f00\u53d1\u73af\u5883\u6709\u6548\uff1f">\u4e3a\u4ec0\u4e48\u53ea\u5bf9\u5f00\u53d1\u73af\u5883\u6709\u6548\uff1f<a onclick="window.location.hash = \'\u4e3a\u4ec0\u4e48\u53ea\u5bf9\u5f00\u53d1\u73af\u5883\u6709\u6548\uff1f\'" class="anchor">#</a></h3><p>Mock \u5e76\u975e\u662f\u771f\u5b9e\u6570\u636e\uff0c\u5927\u90e8\u5206\u573a\u666f\u662f\u9488\u5bf9\u5f00\u53d1\u672c\u5730\u6216\u6d4b\u8bd5\u73af\u5883\uff1b\u6240\u4ee5\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u4e0d\u5e94\u8be5\u5305\u62ec Mock \u6a21\u5757\u4ee5\u53ca\u89c4\u5219\u6570\u636e\u3002\u56e0\u6b64\u4e0a\u8ff0\u624d\u4f1a\u6839\u636e <code>!environment.production</code> \u4f9d\u636e\u73af\u5883\u6765\u51b3\u5b9a\u662f\u5426\u52a0\u8f7d <code>DelonMockModule</code>\u3002</p><p>\u5f53\u7136\uff0c\u4f60\u4f9d\u7136\u53ef\u4ee5\u5728\u751f\u4ea7\u73af\u5883\u4e5f\u4f7f\u7528\u8fd9\u79cd\u89c4\u5219\uff0c\u5c31\u50cf //ng-alain.github.io/ng-alain/ \u4e00\u6837\uff0c\u9700\u8981\u4e00\u4e9b\u6a21\u62df\u8bf7\u6c42\u6765\u4fdd\u8bc1\u73af\u5883\u7684\u8fd0\u884c\u3002</p><pre class="hljs language-ts"><code>import { DelonMockModule } from \'@delon/mock\';\nimport * as MOCKDATA from \'../../_mock\';\n@NgModule({\n imports: [\n DelonMockModule.forRoot({ data: MOCKDATA })\n ]\n})</code></pre></article></section>',meta:{order:1,title:"\u5f00\u59cb\u4f7f\u7528",type:"Documents"},toc:[{id:"\u5199\u5728\u524d\u9762",title:"\u5199\u5728\u524d\u9762",h:2},{id:"\u5982\u4f55\u4f7f\u7528",title:"\u5982\u4f55\u4f7f\u7528",h:2},{id:"MockOptions-\u914d\u7f6e",title:"MockOptions \u914d\u7f6e",h:3},{id:"\u4e3a\u4ec0\u4e48\u53ea\u5bf9\u5f00\u53d1\u73af\u5883\u6709\u6548\uff1f",title:"\u4e3a\u4ec0\u4e48\u53ea\u5bf9\u5f00\u53d1\u73af\u5883\u6709\u6548\uff1f",h:3}]}},demo:!1},this.codes=[]}}class n{constructor(){this.item={cols:1,urls:{"en-US":"packages/mock/docs/rule.en-US.md","zh-CN":"packages/mock/docs/rule.zh-CN.md"},content:{"en-US":{content:"<section class=\"markdown\"><article><h2 id=\"Foreword\">Foreword<a onclick=\"window.location.hash = 'Foreword'\" class=\"anchor\">#</a></h2><p>The Mock rule data is an <code>Object</code> object, Key is request declaration, and Value is response data, for example:</p><pre class=\"hljs language-ts\"><code>export const USERS = {\n 'GET /users': { users: [1, 2], total: 2 },\n}</code></pre><p>When send requesting <code>/users</code> via <code>HttpClient</code>, it will directly response <code>{ users: [1, 2], total: 2 }</code>, and will not send any HTTP requests in <code>Network</code> panel.</p><h2 id=\"Key\">Key<a onclick=\"window.location.hash = 'Key'\" class=\"anchor\">#</a></h2><p>Use <code>' '</code>space to separate the request method and URL, the request method can be ignored, the default is <code>GET</code>; the URL supports routing parameters and regular expressions. E.g:</p><pre class=\"hljs language-ts\"><code>export const USERS = {\n 'GET /users': null,\n // GET: can be ingored\n '/users/1': null,\n // POST\n 'POST /users/1': null,\n // Routing parameters\n '/users/:id': null,\n // Regular expressions need to be wrapped with `()`\n '/data/(.*)': null\n};</code></pre><h2 id=\"Value\">Value<a onclick=\"window.location.hash = 'Value'\" class=\"anchor\">#</a></h2><p>Supports three types: <code>Object</code>, <code>Array</code>, <code>(req: MockRequest) => any</code>.</p><pre class=\"hljs language-ts\"><code>import { MockStatusError } from '@delon/mock';\n\nexport const USERS = {\n // Array\n '/users': [ { uid: 1 }, { uid: 2 } ],\n // Object\n '/users': { uid: 1 },\n // Function\n '/qs': (req: MockRequest) => req.queryString.pi,\n // Support HttpResponse\n '/http': (req: MockRequest) => new HttpResponse({ body: 'Body', headers: new HttpHeaders({ 'token': '1' }) }),\n // Send Status Error\n '/404': () => { throw new MockStatusError(404); }\n};</code></pre><h3 id=\"MockRequest\">MockRequest<a onclick=\"window.location.hash = 'MockRequest'\" class=\"anchor\">#</a></h3><table><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>[params]</code></td><td><code>any</code></td><td>Routing parameter, <code>/:id</code> then <code>params.id</code></td></tr><tr><td><code>[queryString]</code></td><td><code>any</code></td><td>URL parameter, <code>/users?pi=1&ps=10</code> then <code>queryString.pi</code>, <code>queryString.ps</code></td></tr><tr><td><code>[headers]</code></td><td><code>any</code></td><td>Headers</td></tr><tr><td><code>[body]</code></td><td><code>any</code></td><td>Body</td></tr><tr><td><code>[original]</code></td><td><code>HttpRequest<any></code></td><td><code>HttpRequest</code></td></tr></tbody></table><h3 id=\"MockStatusError\">MockStatusError<a onclick=\"window.location.hash = 'MockStatusError'\" class=\"anchor\">#</a></h3><p>When you want to respond to a <code>404</code> http status.</p><h2 id=\"Demo\">Demo<a onclick=\"window.location.hash = 'Demo'\" class=\"anchor\">#</a></h2><pre class=\"hljs language-ts\"><code>import { MockStatusError } from '@delon/mock';\n\nexport const USERS = {\n // Support object or array values\n 'GET /users': { users: [1, 2], total: 2 },\n // GET: can be ingored\n '/users/1': { users: [1, 2], total: 2 },\n // POST\n 'POST /users/1': { uid: 1 },\n // Get request parameters: queryString\u3001headers\u3001body\n '/qs': (req: MockRequest) => req.queryString.pi,\n // Routing parameters\n '/users/:id': (req: MockRequest) => req.params, // /users/100, output: { id: 100 }\n // Send Status Error\n '/404': () => { throw new MockStatusError(404); },\n // Regular expressions need to be wrapped with `()`\n '/data/(.*)': (req: MockRequest) => req\n};</code></pre><h2 id=\"Storage-rule\">Storage rule<a onclick=\"window.location.hash = 'Storage-rule'\" class=\"anchor\">#</a></h2><p>In general, Mock is required during development, so recommended to create <code>_mock</code> directory in the project root directory and create <code>index.ts</code> file to export all data rules. See <a href=\"Https://github.com/ng-alain/ng-alain/tree/master/_mock\" data-url=\"Https://github.com/ng-alain/ng-alain/tree/master/_mock\">ng-alain/_mock</a>.</p></article></section>",meta:{order:2,title:"Rule Data",type:"Documents"},toc:[{id:"Foreword",title:"Foreword",h:2},{id:"Key",title:"Key",h:2},{id:"Value",title:"Value",h:2},{id:"MockRequest",title:"MockRequest",h:3},{id:"MockStatusError",title:"MockStatusError",h:3},{id:"Demo",title:"Demo",h:2},{id:"Storage-rule",title:"Storage rule",h:2}]},"zh-CN":{content:"<section class=\"markdown\"><article><h2 id=\"\u5199\u5728\u524d\u9762\">\u5199\u5728\u524d\u9762<a onclick=\"window.location.hash = '\u5199\u5728\u524d\u9762'\" class=\"anchor\">#</a></h2><p>Mock \u89c4\u5219\u6570\u636e\u662f\u4e00\u4e2a <code>Object</code> \u5bf9\u8c61\uff0cKey \u4e3a\u8bf7\u6c42\u57df\u58f0\u660e\uff0cValue \u4e3a\u54cd\u5e94\u5185\u5bb9\uff0c\u4f8b\u5982\uff1a</p><pre class=\"hljs language-ts\"><code>export const USERS = {\n 'GET /users': { users: [1, 2], total: 2 },\n}</code></pre><p>\u8868\u793a\u5f53\u901a\u8fc7 <code>HttpClient.get('/users')</code> \u8bbf\u95ee\u65f6\uff0c\u4f1a\u76f4\u63a5\u8fd4\u56de <code>{ users: [1, 2], total: 2 }</code>\uff0c\u5e76\u4e14\u4e0d\u4f1a\u53d1\u9001\u4efb\u4f55 HTTP \u8bf7\u6c42\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7 <code>Network</code> \u9762\u677f\u6765\u786e\u8ba4\u3002</p><h2 id=\"Key-\u8bf7\u6c42\u57df\u58f0\u660e\">Key \u8bf7\u6c42\u57df\u58f0\u660e<a onclick=\"window.location.hash = 'Key-\u8bf7\u6c42\u57df\u58f0\u660e'\" class=\"anchor\">#</a></h2><p>\u4f7f\u7528 <code>' '</code> \u7a7a\u683c\u6765\u533a\u9694\u8bf7\u6c42\u65b9\u6cd5\u548cURL\uff0c\u8bf7\u6c42\u65b9\u6cd5\u53ef\u5ffd\u7565\uff0c\u9ed8\u8ba4\u4e3a <code>GET</code>\uff1bURL \u652f\u6301\u8def\u7531\u53c2\u6570\u548c\u6b63\u5219\u8868\u8fbe\u5f0f\u3002\u4e00\u4e9b\u6709\u6548\u7684 Key\uff1a</p><pre class=\"hljs language-ts\"><code>export const USERS = {\n 'GET /users': null,\n // GET \u53ef\u7701\u7565\n '/users/1': null,\n // POST \u8bf7\u6c42\n 'POST /users/1': null,\n // \u8def\u7531\u53c2\u6570\n '/users/:id': null,\n // \u6b63\u5219\u8868\u8fbe\u5f0f\u9700\u8981\u7528 `()` \u5305\u88f9\n '/data/(.*)': null\n};</code></pre><h2 id=\"Value-\u54cd\u5e94\u5185\u5bb9\">Value \u54cd\u5e94\u5185\u5bb9<a onclick=\"window.location.hash = 'Value-\u54cd\u5e94\u5185\u5bb9'\" class=\"anchor\">#</a></h2><p>\u54cd\u5e94\u5185\u5bb9\u652f\u6301\u4e09\u79cd\u7c7b\u578b\uff1a<code>Object</code>\u3001<code>Array</code>\u3001<code>(req: MockRequest) => any</code>\u3002</p><pre class=\"hljs language-ts\"><code>import { MockStatusError } from '@delon/mock';\n\nexport const USERS = {\n // Array\n '/users': [ { uid: 1 }, { uid: 2 } ],\n // Object\n '/users': { uid: 1 },\n // Function\n '/qs': (req: MockRequest) => req.queryString.pi,\n // \u652f\u6301\u8fd4\u56de\u5b8c\u6574\u7684 HttpResponse\n '/http': (req: MockRequest) => new HttpResponse({ body: 'Body', headers: new HttpHeaders({ 'token': '1' }) }),\n // \u53d1\u9001 Status \u9519\u8bef\n '/404': () => { throw new MockStatusError(404); }\n};</code></pre><h3 id=\"MockRequest\">MockRequest<a onclick=\"window.location.hash = 'MockRequest'\" class=\"anchor\">#</a></h3><table><thead><tr><th>\u540d\u79f0</th><th>\u7c7b\u578b</th><th>\u63cf\u8ff0</th></tr></thead><tbody><tr><td><code>[params]</code></td><td><code>any</code></td><td>\u8def\u7531\u53c2\u6570\uff0c<code>/:id</code> \u5219 <code>params.id</code></td></tr><tr><td><code>[queryString]</code></td><td><code>any</code></td><td>URL\u53c2\u6570\uff0c<code>/users?pi=1&ps=10</code> \u5219 <code>queryString.pi</code>\u3001<code>queryString.ps</code></td></tr><tr><td><code>[headers]</code></td><td><code>any</code></td><td>Headers \u503c</td></tr><tr><td><code>[body]</code></td><td><code>any</code></td><td>\u8bf7\u6c42 body</td></tr><tr><td><code>[original]</code></td><td><code>HttpRequest<any></code></td><td>\u539f\u59cb <code>HttpRequest</code></td></tr></tbody></table><h3 id=\"MockStatusError\">MockStatusError<a onclick=\"window.location.hash = 'MockStatusError'\" class=\"anchor\">#</a></h3><p>\u5f53\u4f60\u5e0c\u671b\u54cd\u5e94\u4e00\u4e2a <code>404</code> \u5f02\u5e38\u65f6\u3002</p><h2 id=\"\u4e00\u4e9b\u793a\u4f8b\">\u4e00\u4e9b\u793a\u4f8b<a onclick=\"window.location.hash = '\u4e00\u4e9b\u793a\u4f8b'\" class=\"anchor\">#</a></h2><pre class=\"hljs language-ts\"><code>import { MockStatusError } from '@delon/mock';\n\nexport const USERS = {\n // \u652f\u6301\u503c\u4e3a Object \u548c Array\n 'GET /users': { users: [1, 2], total: 2 },\n // GET \u53ef\u7701\u7565\n '/users/1': { users: [1, 2], total: 2 },\n // POST \u8bf7\u6c42\n 'POST /users/1': { uid: 1 },\n // \u83b7\u53d6\u8bf7\u6c42\u53c2\u6570 queryString\u3001headers\u3001body\n '/qs': (req: MockRequest) => req.queryString.pi,\n // \u8def\u7531\u53c2\u6570\n '/users/:id': (req: MockRequest) => req.params, // /users/100, output: { id: 100 }\n // \u53d1\u9001 Status \u9519\u8bef\n '/404': () => { throw new MockStatusError(404); },\n // \u4f7f\u7528 () \u8868\u793a\uff1a\u6b63\u5219\u8868\u8fbe\u5f0f\n '/data/(.*)': (req: MockRequest) => req\n};</code></pre><h2 id=\"\u5b58\u50a8\u89c4\u5219\">\u5b58\u50a8\u89c4\u5219<a onclick=\"window.location.hash = '\u5b58\u50a8\u89c4\u5219'\" class=\"anchor\">#</a></h2><p>\u4e00\u822c\u6765\u8bf4 Mock \u90fd\u662f\u5f00\u53d1\u8fc7\u7a0b\u4e2d\u9700\u8981\uff0c\u56e0\u6b64\u5efa\u8bae\u5728\u9879\u76ee\u6839\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a <code>_mock</code> \u76ee\u5f55\uff0c\u5e76\u521b\u5efa\u4e00\u4e2a <code>index.ts</code> \u6587\u4ef6\u7528\u4e8e\u5bfc\u51fa\u6240\u6709\u6570\u636e\u89c4\u5219\uff0c\u53c2\u8003 <a target=\"_blank\" href=\"https://github.com/ng-alain/ng-alain/tree/master/_mock\" data-url=\"https://github.com/ng-alain/ng-alain/tree/master/_mock\">ng-alain/_mock</a>\u3002</p></article></section>",meta:{order:2,title:"\u89c4\u5219\u6570\u636e",type:"Documents"},toc:[{id:"\u5199\u5728\u524d\u9762",title:"\u5199\u5728\u524d\u9762",h:2},{id:"Key-\u8bf7\u6c42\u57df\u58f0\u660e",title:"Key \u8bf7\u6c42\u57df\u58f0\u660e",h:2},{id:"Value-\u54cd\u5e94\u5185\u5bb9",title:"Value \u54cd\u5e94\u5185\u5bb9",h:2},{id:"MockRequest",title:"MockRequest",h:3},{id:"MockStatusError",title:"MockStatusError",h:3},{id:"\u4e00\u4e9b\u793a\u4f8b",title:"\u4e00\u4e9b\u793a\u4f8b",h:2},{id:"\u5b58\u50a8\u89c4\u5219",title:"\u5b58\u50a8\u89c4\u5219",h:2}]}},demo:!1},this.codes=[]}}class r{}var s=t("pMnS"),l=t("EdU/"),i=t("/Yna"),u=t("JRKe"),b=t("Ed4d"),p=t("8WaK"),h=t("QfCi"),G=t("CghO"),k=t("Sq/J"),m=t("GYi0"),g=t("EXx9"),M=t("R6D3"),y=t("WP5L"),S=t("71F0"),w=t("fE+l"),q=t("0RMT"),f=t("QcbP"),R=t("0D9X"),T=t("SpJI"),E=t("hBP+"),O=t("QPFe"),D=t("RdGh"),j=t("D9vs"),U=t("DyZ0"),z=t("TY3c"),v=t("u+Cy"),C=t("8+8K"),H=t("YVZs"),A=t("F/j7"),F=t("/EOF"),x=t("ZKYL"),K=t("SZk1"),P=t("5eO6"),N=t("9BMt"),V=t("kRch"),Y=t("QkPN"),I=t("vBNu"),L=t("Z7t+"),B=t("II6v"),Q=t("MRB6"),_=t("uU7u"),J=t("iInd"),Z=t("cUpR"),W=a.ub({encapsulation:0,styles:["[_nghost-%COMP%] { display: block }"],data:{}});function X(e){return a.Sb(0,[(e()(),a.wb(0,0,null,null,1,"app-docs",[],null,null,null,L.b,L.a)),a.vb(1,245760,null,0,B.a,[Q.a,_.a,J.p,Z.b],{codes:[0,"codes"],item:[1,"item"]},null)],(function(e,o){var t=o.component;e(o,1,0,t.codes,t.item)}),null)}function $(e){return a.Sb(0,[(e()(),a.wb(0,0,null,null,1,"app-mock-getting-started",[],null,null,null,X,W)),a.vb(1,49152,null,0,c,[],null,null)],null,null)}var ee=a.sb("app-mock-getting-started",c,$,{},{},[]),oe=a.ub({encapsulation:0,styles:["[_nghost-%COMP%] { display: block }"],data:{}});function te(e){return a.Sb(0,[(e()(),a.wb(0,0,null,null,1,"app-docs",[],null,null,null,L.b,L.a)),a.vb(1,245760,null,0,B.a,[Q.a,_.a,J.p,Z.b],{codes:[0,"codes"],item:[1,"item"]},null)],(function(e,o){var t=o.component;e(o,1,0,t.codes,t.item)}),null)}function ae(e){return a.Sb(0,[(e()(),a.wb(0,0,null,null,1,"app-mock-rule",[],null,null,null,te,oe)),a.vb(1,49152,null,0,n,[],null,null)],null,null)}var de=a.sb("app-mock-rule",n,ae,{},{},[]),ce=t("SVse"),ne=t("s7LF"),re=t("5VGP"),se=t("QQfA"),le=t("IP0z"),ie=t("POq0"),ue=t("sAdM"),be=t("ekcc"),pe=t("pQl/"),he=t("g+Fz"),Ge=t("Ybye"),ke=t("NFMk"),me=t("10Ig"),ge=t("iC8E"),Me=t("/HVE"),ye=t("v1Dh"),Se=t("66zS"),we=t("5Izy"),qe=t("yTpB"),fe=t("zMNK"),Re=t("hOhj"),Te=t("r19J"),Ee=t("anqq"),Oe=t("IYs4"),De=t("EcpC"),je=t("GaVp"),Ue=t("/L1H"),ze=t("phDe"),ve=t("rJp6"),Ce=t("Rgb0"),He=t("kS4m"),Ae=t("mW00"),Fe=t("jTf7"),xe=t("WPSl"),Ke=t("YdS3"),Pe=t("wQFA"),Ne=t("px0D"),Ve=t("3ZFI"),Ye=t("CYS+"),Ie=t("oBm0"),Le=t("A7zk"),Be=t("YRt3"),Qe=t("lAiz"),_e=t("ce6n"),Je=t("SBNi"),Ze=t("7QIX"),We=t("tYkK"),Xe=t("wf2+"),$e=t("eCGT"),eo=t("nHXS"),oo=t("fb/r"),to=t("zTFG"),ao=t("JK0T"),co=t("JXeA"),no=t("0CZq"),ro=t("qU0y"),so=t("vZsH"),lo=t("W4B1"),io=t("SHEi"),uo=t("FPpa"),bo=t("RVNi"),po=t("NDed"),ho=t("5A4h"),Go=t("N2O2"),ko=t("ozKM"),mo=t("OvZZ"),go=t("z+yo"),Mo=t("DQmg"),yo=t("haRT"),So=t("1+nf"),wo=t("XFzh"),qo=t("p+Sl"),fo=t("HhpN"),Ro=t("SN7N"),To=t("fwnu"),Eo=t("VbP7"),Oo=t("gaRz"),Do=t("e15G"),jo=t("+YBk"),Uo=t("9J0+"),zo=t("vIiB"),vo=t("CGSU"),Co=t("5CFV"),Ho=t("GTZx"),Ao=t("hS58"),Fo=t("+ndR"),xo=t("EWQH"),Ko=t("aq9g"),Po=t("7Dpl"),No=t("ekmu"),Vo=t("vjj7"),Yo=t("l/Xz"),Io=t("sRo1"),Lo=t("BQzg"),Bo=t("YQXl"),Qo=t("dZIx"),_o=t("9bzR"),Jo=t("WNQ9"),Zo=t("5Oon"),Wo=t("lM9c"),Xo=t("OSVY"),$o=t("MNSj"),et=t("MZBU"),ot=t("ev4S"),tt=t("G1y0"),at=t("5sGc"),dt=t("4/RT"),ct=t("Q1qs"),nt=t("k5cy"),rt=t("ceoF"),st=t("gQlp"),lt=t("XYAa"),it=t("vrge"),ut=t("nMAq"),bt=t("5PV9"),pt=t("nIn3"),ht=t("xo13"),Gt=t("CnVV"),kt=t("5p8d"),mt=t("qYUw"),gt=t("JpOc"),Mt=t("VRoF"),yt=t("Uto7"),St=t("/p+U"),wt=t("ye40"),qt=t("qcxY"),ft=t("T+Em"),Rt=t("ucmY"),Tt=t("sbFH"),Et=t("76lH"),Ot=t("TSSN"),Dt=t("Fg/6"),jt=t("kzz5"),Ut=t("SqF5"),zt=t("Wl7g"),vt=t("+TYD"),Ct=t("PCNd");t.d(o,"MockModuleNgFactory",(function(){return Ht}));var Ht=a.tb(r,[],(function(e){return a.Fb([a.Gb(512,a.j,a.db,[[8,[s.a,l.a,l.b,i.a,u.a,b.a,p.a,h.a,G.a,k.a,m.a,g.a,M.a,y.a,S.a,w.a,q.a,f.a,R.a,T.a,E.a,O.a,D.a,j.a,U.a,z.a,v.a,C.a,H.a,A.a,F.a,x.a,K.a,P.a,N.a,V.a,Y.a,I.a,ee,de]],[3,a.j],a.w]),a.Gb(4608,ce.p,ce.o,[a.t,[2,ce.K]]),a.Gb(4608,ne.x,ne.x,[]),a.Gb(4608,ne.e,ne.e,[]),a.Gb(5120,re.z,re.M,[ce.e,[3,re.z]]),a.Gb(4608,se.d,se.d,[se.k,se.f,a.j,se.i,se.g,a.q,a.y,ce.e,le.b,[2,ce.j]]),a.Gb(5120,se.l,se.m,[se.d]),a.Gb(4608,ie.c,ie.c,[]),a.Gb(5120,ue.b,ue.a,[[3,ue.b],be.a]),a.Gb(4608,pe.d,pe.d,[a.y]),a.Gb(4608,he.d,he.d,[ce.e]),a.Gb(4608,Ge.a,Ge.a,[ke.g]),a.Gb(4608,me.a,me.a,[ge.d]),a.Gb(1073742336,ce.c,ce.c,[]),a.Gb(1073742336,ne.w,ne.w,[]),a.Gb(1073742336,ne.j,ne.j,[]),a.Gb(1073742336,J.t,J.t,[[2,J.y],[2,J.p]]),a.Gb(1073742336,ne.t,ne.t,[]),a.Gb(1073742336,Me.b,Me.b,[]),a.Gb(1073742336,ye.b,ye.b,[]),a.Gb(1073742336,Se.b,Se.b,[]),a.Gb(1073742336,re.j,re.j,[]),a.Gb(1073742336,we.b,we.b,[]),a.Gb(1073742336,qe.a,qe.a,[]),a.Gb(1073742336,le.a,le.a,[]),a.Gb(1073742336,fe.e,fe.e,[]),a.Gb(1073742336,Re.g,Re.g,[]),a.Gb(1073742336,se.h,se.h,[]),a.Gb(1073742336,re.w,re.w,[]),a.Gb(1073742336,Te.b,Te.b,[]),a.Gb(1073742336,Ee.b,Ee.b,[]),a.Gb(1073742336,Oe.b,Oe.b,[]),a.Gb(1073742336,ie.d,ie.d,[]),a.Gb(1073742336,De.b,De.b,[]),a.Gb(1073742336,re.J,re.J,[]),a.Gb(1073742336,je.c,je.c,[]),a.Gb(1073742336,re.x,re.x,[]),a.Gb(1073742336,Ue.e,Ue.e,[]),a.Gb(1073742336,ze.i,ze.i,[]),a.Gb(1073742336,ze.a,ze.a,[]),a.Gb(1073742336,ze.f,ze.f,[]),a.Gb(1073742336,ve.c,ve.c,[]),a.Gb(1073742336,Ce.b,Ce.b,[]),a.Gb(1073742336,He.d,He.d,[]),a.Gb(1073742336,Ae.c,Ae.c,[]),a.Gb(1073742336,Fe.h,Fe.h,[]),a.Gb(1073742336,xe.f,xe.f,[]),a.Gb(1073742336,Ke.d,Ke.d,[]),a.Gb(1073742336,Pe.d,Pe.d,[]),a.Gb(1073742336,re.s,re.s,[]),a.Gb(1073742336,Ne.d,Ne.d,[]),a.Gb(1073742336,Ve.b,Ve.b,[]),a.Gb(1073742336,Ye.c,Ye.c,[]),a.Gb(1073742336,Ie.a,Ie.a,[]),a.Gb(1073742336,Le.a,Le.a,[]),a.Gb(1073742336,Be.b,Be.b,[]),a.Gb(1073742336,Qe.g,Qe.g,[]),a.Gb(1073742336,Qe.b,Qe.b,[]),a.Gb(1073742336,_e.a,_e.a,[]),a.Gb(1073742336,Je.b,Je.b,[]),a.Gb(1073742336,ge.e,ge.e,[]),a.Gb(1073742336,ge.b,ge.b,[]),a.Gb(1073742336,Ze.b,Ze.b,[]),a.Gb(1073742336,We.b,We.b,[]),a.Gb(1073742336,Xe.g,Xe.g,[]),a.Gb(1073742336,$e.b,$e.b,[]),a.Gb(1073742336,eo.a,eo.a,[]),a.Gb(1073742336,oo.b,oo.b,[]),a.Gb(1073742336,to.d,to.d,[]),a.Gb(1073742336,ao.b,ao.b,[]),a.Gb(1073742336,co.h,co.h,[]),a.Gb(1073742336,co.f,co.f,[]),a.Gb(1073742336,re.y,re.y,[]),a.Gb(1073742336,ke.h,ke.h,[]),a.Gb(1073742336,ke.d,ke.d,[]),a.Gb(1073742336,ke.e,ke.e,[]),a.Gb(1073742336,no.f,no.f,[]),a.Gb(1073742336,no.e,no.e,[]),a.Gb(1073742336,ro.a,ro.a,[]),a.Gb(1073742336,so.b,so.b,[]),a.Gb(1073742336,lo.b,lo.b,[]),a.Gb(1073742336,io.c,io.c,[]),a.Gb(1073742336,uo.c,uo.c,[]),a.Gb(1073742336,bo.b,bo.b,[]),a.Gb(1073742336,po.c,po.c,[]),a.Gb(1073742336,ho.a,ho.a,[]),a.Gb(1073742336,Go.b,Go.b,[]),a.Gb(1073742336,ko.d,ko.d,[]),a.Gb(1073742336,mo.a,mo.a,[]),a.Gb(1073742336,go.c,go.c,[]),a.Gb(1073742336,Mo.b,Mo.b,[]),a.Gb(1073742336,yo.b,yo.b,[]),a.Gb(1073742336,So.f,So.f,[]),a.Gb(1073742336,wo.b,wo.b,[]),a.Gb(1073742336,qo.a,qo.a,[]),a.Gb(1073742336,re.D,re.D,[]),a.Gb(1073742336,fo.c,fo.c,[]),a.Gb(1073742336,Ro.b,Ro.b,[]),a.Gb(1073742336,To.b,To.b,[]),a.Gb(1073742336,re.o,re.o,[]),a.Gb(1073742336,Eo.a,Eo.a,[]),a.Gb(1073742336,Oo.d,Oo.d,[]),a.Gb(1073742336,Do.a,Do.a,[]),a.Gb(1073742336,jo.a,jo.a,[]),a.Gb(1073742336,Uo.a,Uo.a,[Se.c]),a.Gb(1073742336,zo.a,zo.a,[]),a.Gb(1073742336,vo.a,vo.a,[]),a.Gb(1073742336,Co.a,Co.a,[]),a.Gb(1073742336,Ho.a,Ho.a,[]),a.Gb(1073742336,Ao.a,Ao.a,[]),a.Gb(1073742336,Fo.a,Fo.a,[]),a.Gb(1073742336,xo.a,xo.a,[]),a.Gb(1073742336,Ko.a,Ko.a,[]),a.Gb(1073742336,Po.a,Po.a,[]),a.Gb(1073742336,No.a,No.a,[]),a.Gb(1073742336,Vo.a,Vo.a,[]),a.Gb(1073742336,Yo.a,Yo.a,[]),a.Gb(1073742336,Io.a,Io.a,[]),a.Gb(1073742336,Lo.a,Lo.a,[]),a.Gb(1073742336,pe.c,pe.c,[]),a.Gb(1073742336,Bo.a,Bo.a,[]),a.Gb(1073742336,Qo.a,Qo.a,[]),a.Gb(1073742336,_o.a,_o.a,[]),a.Gb(1073742336,Jo.a,Jo.a,[]),a.Gb(1073742336,Zo.a,Zo.a,[]),a.Gb(1073742336,Wo.a,Wo.a,[]),a.Gb(1073742336,Xo.a,Xo.a,[]),a.Gb(1073742336,$o.a,$o.a,[]),a.Gb(1073742336,et.a,et.a,[]),a.Gb(1073742336,ot.a,ot.a,[]),a.Gb(1073742336,tt.a,tt.a,[]),a.Gb(1073742336,at.a,at.a,[]),a.Gb(1073742336,dt.a,dt.a,[]),a.Gb(1073742336,ct.a,ct.a,[]),a.Gb(1073742336,nt.a,nt.a,[]),a.Gb(1073742336,rt.a,rt.a,[]),a.Gb(1073742336,st.a,st.a,[]),a.Gb(1073742336,lt.a,lt.a,[]),a.Gb(1073742336,it.a,it.a,[]),a.Gb(1073742336,ut.a,ut.a,[]),a.Gb(1073742336,bt.a,bt.a,[]),a.Gb(1073742336,pt.a,pt.a,[]),a.Gb(1073742336,ht.a,ht.a,[]),a.Gb(1073742336,Gt.a,Gt.a,[]),a.Gb(1073742336,kt.a,kt.a,[]),a.Gb(1073742336,mt.a,mt.a,[]),a.Gb(1073742336,gt.a,gt.a,[]),a.Gb(1073742336,Mt.a,Mt.a,[]),a.Gb(1073742336,yt.a,yt.a,[]),a.Gb(1073742336,St.a,St.a,[]),a.Gb(1073742336,wt.a,wt.a,[]),a.Gb(1073742336,qt.a,qt.a,[]),a.Gb(1073742336,ft.a,ft.a,[]),a.Gb(1073742336,Rt.a,Rt.a,[]),a.Gb(1073742336,Tt.a,Tt.a,[]),a.Gb(1073742336,Et.a,Et.a,[]),a.Gb(1073742336,Ot.h,Ot.h,[]),a.Gb(1073742336,Dt.b,Dt.b,[]),a.Gb(1073742336,jt.a,jt.a,[]),a.Gb(1073742336,he.c,he.c,[]),a.Gb(1073742336,Ut.c,Ut.c,[]),a.Gb(1073742336,zt.d,zt.d,[]),a.Gb(1073742336,zt.h,zt.h,[]),a.Gb(1073742336,zt.b,zt.b,[]),a.Gb(1073742336,zt.j,zt.j,[]),a.Gb(1073742336,zt.l,zt.l,[]),a.Gb(1073742336,zt.p,zt.p,[]),a.Gb(1073742336,zt.t,zt.t,[]),a.Gb(1073742336,vt.a,vt.a,[]),a.Gb(1073742336,Ct.a,Ct.a,[]),a.Gb(1073742336,r,r,[]),a.Gb(256,co.b,{nzAnimate:!0,nzDuration:3e3,nzMaxStack:7,nzPauseOnHover:!0,nzTop:24},[]),a.Gb(256,no.b,{nzTop:"24px",nzBottom:"24px",nzPlacement:"topRight",nzDuration:4500,nzMaxStack:7,nzPauseOnHover:!0,nzAnimate:!0},[]),a.Gb(256,be.a,jo.b,[]),a.Gb(1024,J.n,(function(){return[[{path:"",component:d.a,children:[{path:"",redirectTo:"getting-started/zh",pathMatch:"full"},{path:"getting-started",redirectTo:"getting-started/zh",pathMatch:"full"},{path:"getting-started/:lang",component:c},{path:"rule",redirectTo:"rule/zh",pathMatch:"full"},{path:"rule/:lang",component:n}]}]]}),[])])}))}}]);