This repository has been 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
/
Copy path18-es5.9da013ce9d5a697c1c1c.js
1 lines (1 loc) · 28.3 KB
/
18-es5.9da013ce9d5a697c1c1c.js
1
function _classCallCheck(e,o){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}(window.webpackJsonp=window.webpackJsonp||[]).push([[18],{RTYZ:function(e,o,t){"use strict";t.r(o);var a=t("8Y7J"),d=t("0qEG"),c=function e(){_classCallCheck(this,e),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>\ud83d\udc7dMock</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\ud83d\udc7dMock\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=[]},n=function e(){_classCallCheck(this,e),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=[]},r=function e(){_classCallCheck(this,e)},s=t("pMnS"),l=t("EdU/"),i=t("/Yna"),u=t("JRKe"),b=t("Ed4d"),h=t("8WaK"),p=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"),C=t("DyZ0"),U=t("TY3c"),z=t("u+Cy"),v=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"),_=t("vBNu"),I=t("Z7t+"),L=t("II6v"),B=t("MRB6"),Q=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,I.b,I.a)),a.vb(1,245760,null,0,L.a,[B.a,Q.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)}var $=a.sb("app-mock-getting-started",c,(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)}),{},{},[]),ee=a.ub({encapsulation:0,styles:["[_nghost-%COMP%] { display: block }"],data:{}});function oe(e){return a.Sb(0,[(e()(),a.wb(0,0,null,null,1,"app-docs",[],null,null,null,I.b,I.a)),a.vb(1,245760,null,0,L.a,[B.a,Q.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)}var te=a.sb("app-mock-rule",n,(function(e){return a.Sb(0,[(e()(),a.wb(0,0,null,null,1,"app-mock-rule",[],null,null,null,oe,ee)),a.vb(1,49152,null,0,n,[],null,null)],null,null)}),{},{},[]),ae=t("SVse"),de=t("s7LF"),ce=t("5VGP"),ne=t("QQfA"),re=t("IP0z"),se=t("POq0"),le=t("sAdM"),ie=t("ekcc"),ue=t("pQl/"),be=t("g+Fz"),he=t("Ybye"),pe=t("NFMk"),Ge=t("10Ig"),ke=t("iC8E"),me=t("/HVE"),ge=t("v1Dh"),Me=t("66zS"),ye=t("5Izy"),Se=t("yTpB"),we=t("zMNK"),qe=t("hOhj"),fe=t("r19J"),Re=t("anqq"),Te=t("IYs4"),Ee=t("EcpC"),Oe=t("GaVp"),De=t("/L1H"),je=t("phDe"),Ce=t("rJp6"),Ue=t("Rgb0"),ze=t("kS4m"),ve=t("mW00"),He=t("jTf7"),Ae=t("WPSl"),Fe=t("YdS3"),xe=t("wQFA"),Ke=t("px0D"),Pe=t("3ZFI"),Ne=t("CYS+"),Ve=t("oBm0"),Ye=t("A7zk"),_e=t("YRt3"),Ie=t("lAiz"),Le=t("ce6n"),Be=t("SBNi"),Qe=t("7QIX"),Je=t("tYkK"),Ze=t("wf2+"),We=t("eCGT"),Xe=t("nHXS"),$e=t("fb/r"),eo=t("zTFG"),oo=t("JK0T"),to=t("JXeA"),ao=t("0CZq"),co=t("qU0y"),no=t("vZsH"),ro=t("W4B1"),so=t("SHEi"),lo=t("FPpa"),io=t("RVNi"),uo=t("NDed"),bo=t("5A4h"),ho=t("N2O2"),po=t("ozKM"),Go=t("OvZZ"),ko=t("z+yo"),mo=t("DQmg"),go=t("haRT"),Mo=t("1+nf"),yo=t("XFzh"),So=t("p+Sl"),wo=t("HhpN"),qo=t("SN7N"),fo=t("fwnu"),Ro=t("VbP7"),To=t("gaRz"),Eo=t("e15G"),Oo=t("+YBk"),Do=t("9J0+"),jo=t("vIiB"),Co=t("CGSU"),Uo=t("5CFV"),zo=t("GTZx"),vo=t("hS58"),Ho=t("+ndR"),Ao=t("EWQH"),Fo=t("aq9g"),xo=t("7Dpl"),Ko=t("ekmu"),Po=t("vjj7"),No=t("l/Xz"),Vo=t("sRo1"),Yo=t("BQzg"),_o=t("YQXl"),Io=t("dZIx"),Lo=t("9bzR"),Bo=t("WNQ9"),Qo=t("5Oon"),Jo=t("lM9c"),Zo=t("OSVY"),Wo=t("MNSj"),Xo=t("MZBU"),$o=t("ev4S"),et=t("G1y0"),ot=t("5sGc"),tt=t("4/RT"),at=t("Q1qs"),dt=t("k5cy"),ct=t("ceoF"),nt=t("gQlp"),rt=t("XYAa"),st=t("vrge"),lt=t("nMAq"),it=t("5PV9"),ut=t("nIn3"),bt=t("xo13"),ht=t("CnVV"),pt=t("5p8d"),Gt=t("qYUw"),kt=t("JpOc"),mt=t("VRoF"),gt=t("Uto7"),Mt=t("/p+U"),yt=t("ye40"),St=t("qcxY"),wt=t("T+Em"),qt=t("ucmY"),ft=t("sbFH"),Rt=t("76lH"),Tt=t("TSSN"),Et=t("Fg/6"),Ot=t("kzz5"),Dt=t("SqF5"),jt=t("Wl7g"),Ct=t("+TYD"),Ut=t("PCNd");t.d(o,"MockModuleNgFactory",(function(){return zt}));var zt=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,h.a,p.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,C.a,U.a,z.a,v.a,H.a,A.a,F.a,x.a,K.a,P.a,N.a,V.a,Y.a,_.a,$,te]],[3,a.j],a.w]),a.Gb(4608,ae.p,ae.o,[a.t,[2,ae.K]]),a.Gb(4608,de.x,de.x,[]),a.Gb(4608,de.e,de.e,[]),a.Gb(5120,ce.z,ce.M,[ae.e,[3,ce.z]]),a.Gb(4608,ne.d,ne.d,[ne.k,ne.f,a.j,ne.i,ne.g,a.q,a.y,ae.e,re.b,[2,ae.j]]),a.Gb(5120,ne.l,ne.m,[ne.d]),a.Gb(4608,se.c,se.c,[]),a.Gb(5120,le.b,le.a,[[3,le.b],ie.a]),a.Gb(4608,ue.d,ue.d,[a.y]),a.Gb(4608,be.d,be.d,[ae.e]),a.Gb(4608,he.a,he.a,[pe.g]),a.Gb(4608,Ge.a,Ge.a,[ke.d]),a.Gb(1073742336,ae.c,ae.c,[]),a.Gb(1073742336,de.w,de.w,[]),a.Gb(1073742336,de.j,de.j,[]),a.Gb(1073742336,J.t,J.t,[[2,J.y],[2,J.p]]),a.Gb(1073742336,de.t,de.t,[]),a.Gb(1073742336,me.b,me.b,[]),a.Gb(1073742336,ge.b,ge.b,[]),a.Gb(1073742336,Me.b,Me.b,[]),a.Gb(1073742336,ce.j,ce.j,[]),a.Gb(1073742336,ye.b,ye.b,[]),a.Gb(1073742336,Se.a,Se.a,[]),a.Gb(1073742336,re.a,re.a,[]),a.Gb(1073742336,we.e,we.e,[]),a.Gb(1073742336,qe.g,qe.g,[]),a.Gb(1073742336,ne.h,ne.h,[]),a.Gb(1073742336,ce.w,ce.w,[]),a.Gb(1073742336,fe.b,fe.b,[]),a.Gb(1073742336,Re.b,Re.b,[]),a.Gb(1073742336,Te.b,Te.b,[]),a.Gb(1073742336,se.d,se.d,[]),a.Gb(1073742336,Ee.b,Ee.b,[]),a.Gb(1073742336,ce.J,ce.J,[]),a.Gb(1073742336,Oe.c,Oe.c,[]),a.Gb(1073742336,ce.x,ce.x,[]),a.Gb(1073742336,De.e,De.e,[]),a.Gb(1073742336,je.i,je.i,[]),a.Gb(1073742336,je.a,je.a,[]),a.Gb(1073742336,je.f,je.f,[]),a.Gb(1073742336,Ce.c,Ce.c,[]),a.Gb(1073742336,Ue.b,Ue.b,[]),a.Gb(1073742336,ze.d,ze.d,[]),a.Gb(1073742336,ve.c,ve.c,[]),a.Gb(1073742336,He.h,He.h,[]),a.Gb(1073742336,Ae.f,Ae.f,[]),a.Gb(1073742336,Fe.d,Fe.d,[]),a.Gb(1073742336,xe.d,xe.d,[]),a.Gb(1073742336,ce.s,ce.s,[]),a.Gb(1073742336,Ke.d,Ke.d,[]),a.Gb(1073742336,Pe.b,Pe.b,[]),a.Gb(1073742336,Ne.c,Ne.c,[]),a.Gb(1073742336,Ve.a,Ve.a,[]),a.Gb(1073742336,Ye.a,Ye.a,[]),a.Gb(1073742336,_e.b,_e.b,[]),a.Gb(1073742336,Ie.g,Ie.g,[]),a.Gb(1073742336,Ie.b,Ie.b,[]),a.Gb(1073742336,Le.a,Le.a,[]),a.Gb(1073742336,Be.b,Be.b,[]),a.Gb(1073742336,ke.e,ke.e,[]),a.Gb(1073742336,ke.b,ke.b,[]),a.Gb(1073742336,Qe.b,Qe.b,[]),a.Gb(1073742336,Je.b,Je.b,[]),a.Gb(1073742336,Ze.g,Ze.g,[]),a.Gb(1073742336,We.b,We.b,[]),a.Gb(1073742336,Xe.a,Xe.a,[]),a.Gb(1073742336,$e.b,$e.b,[]),a.Gb(1073742336,eo.d,eo.d,[]),a.Gb(1073742336,oo.b,oo.b,[]),a.Gb(1073742336,to.h,to.h,[]),a.Gb(1073742336,to.f,to.f,[]),a.Gb(1073742336,ce.y,ce.y,[]),a.Gb(1073742336,pe.h,pe.h,[]),a.Gb(1073742336,pe.d,pe.d,[]),a.Gb(1073742336,pe.e,pe.e,[]),a.Gb(1073742336,ao.f,ao.f,[]),a.Gb(1073742336,ao.e,ao.e,[]),a.Gb(1073742336,co.a,co.a,[]),a.Gb(1073742336,no.b,no.b,[]),a.Gb(1073742336,ro.b,ro.b,[]),a.Gb(1073742336,so.c,so.c,[]),a.Gb(1073742336,lo.c,lo.c,[]),a.Gb(1073742336,io.b,io.b,[]),a.Gb(1073742336,uo.c,uo.c,[]),a.Gb(1073742336,bo.a,bo.a,[]),a.Gb(1073742336,ho.b,ho.b,[]),a.Gb(1073742336,po.d,po.d,[]),a.Gb(1073742336,Go.a,Go.a,[]),a.Gb(1073742336,ko.c,ko.c,[]),a.Gb(1073742336,mo.b,mo.b,[]),a.Gb(1073742336,go.b,go.b,[]),a.Gb(1073742336,Mo.f,Mo.f,[]),a.Gb(1073742336,yo.b,yo.b,[]),a.Gb(1073742336,So.a,So.a,[]),a.Gb(1073742336,ce.D,ce.D,[]),a.Gb(1073742336,wo.c,wo.c,[]),a.Gb(1073742336,qo.b,qo.b,[]),a.Gb(1073742336,fo.b,fo.b,[]),a.Gb(1073742336,ce.o,ce.o,[]),a.Gb(1073742336,Ro.a,Ro.a,[]),a.Gb(1073742336,To.d,To.d,[]),a.Gb(1073742336,Eo.a,Eo.a,[]),a.Gb(1073742336,Oo.a,Oo.a,[]),a.Gb(1073742336,Do.a,Do.a,[Me.c]),a.Gb(1073742336,jo.a,jo.a,[]),a.Gb(1073742336,Co.a,Co.a,[]),a.Gb(1073742336,Uo.a,Uo.a,[]),a.Gb(1073742336,zo.a,zo.a,[]),a.Gb(1073742336,vo.a,vo.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,ue.c,ue.c,[]),a.Gb(1073742336,_o.a,_o.a,[]),a.Gb(1073742336,Io.a,Io.a,[]),a.Gb(1073742336,Lo.a,Lo.a,[]),a.Gb(1073742336,Bo.a,Bo.a,[]),a.Gb(1073742336,Qo.a,Qo.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,ht.a,ht.a,[]),a.Gb(1073742336,pt.a,pt.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.h,Tt.h,[]),a.Gb(1073742336,Et.b,Et.b,[]),a.Gb(1073742336,Ot.a,Ot.a,[]),a.Gb(1073742336,be.c,be.c,[]),a.Gb(1073742336,Dt.c,Dt.c,[]),a.Gb(1073742336,jt.d,jt.d,[]),a.Gb(1073742336,jt.h,jt.h,[]),a.Gb(1073742336,jt.b,jt.b,[]),a.Gb(1073742336,jt.j,jt.j,[]),a.Gb(1073742336,jt.l,jt.l,[]),a.Gb(1073742336,jt.p,jt.p,[]),a.Gb(1073742336,jt.t,jt.t,[]),a.Gb(1073742336,Ct.a,Ct.a,[]),a.Gb(1073742336,Ut.a,Ut.a,[]),a.Gb(1073742336,r,r,[]),a.Gb(256,to.b,{nzAnimate:!0,nzDuration:3e3,nzMaxStack:7,nzPauseOnHover:!0,nzTop:24},[]),a.Gb(256,ao.b,{nzTop:"24px",nzBottom:"24px",nzPlacement:"topRight",nzDuration:4500,nzMaxStack:7,nzPauseOnHover:!0,nzAnimate:!0},[]),a.Gb(256,ie.a,Oo.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}]}]]}),[])])}))}}]);