angular-cn/aio/dist/generated/docs/api/common/http/testing/HttpClientTestingModule.json

5 lines
5.6 KiB
JSON

{
"id": "api/common/http/testing/HttpClientTestingModule",
"title": "HttpClientTestingModule",
"contents": "\n\n<article>\n <div class=\"breadcrumb-container\">\n <div class=\"breadcrumb\">\n <script type=\"application/ld+json\">\n {\n \"@context\": \"http://schema.org\",\n \"@type\": \"BreadcrumbList\",\n \"itemListElement\": [\n { \"@type\": \"ListItem\", \"position\": 1, \"item\": { \"@id\": \"https://angular.io//api\", \"name\": \"API\" } },\n { \"@type\": \"ListItem\", \"position\": 2, \"item\": { \"@id\": \"https://angular.io/api/common\", \"name\": \"@angular/common\" } },\n { \"@type\": \"ListItem\", \"position\": 3, \"item\": { \"@id\": \"https://angular.io/api/common/http/testing\", \"name\": \"@angular/common/http/testing\" } },\n { \"@type\": \"ListItem\", \"position\": 4, \"item\": { \"@id\": \"https://angular.io/api/common/http/testing/HttpClientTestingModule\", \"name\": \"HttpClientTestingModule\" } }\n ]\n }\n </script>\n <a href=\"/api\">API</a> > <a href=\"api/common\">@angular/common</a> > <a href=\"api/common/http/testing\">@angular/common/http/testing</a>\n </div>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/packages/common/http/testing/src/module.ts?message=docs(common)%3A%20describe%20your%20change...#L14-L34\" aria-label=\"Suggest Edits\" title=\"Suggest Edits\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n <a href=\"https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/http/testing/src/module.ts#L14-L34\" aria-label=\"View Source\" title=\"View Source\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">code</i></a>\n</div>\n </div>\n \n <header class=\"api-header\">\n <h1 id=\"httpclienttestingmodule\">HttpClientTestingModule<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/http/testing/HttpClientTestingModule#httpclienttestingmodule\"><i class=\"material-icons\">link</i></a></h1>\n \n <label class=\"api-type-label ngmodule\">ngmodule</label>\n \n \n \n </header>\n \n <aio-toc class=\"embedded\"></aio-toc>\n\n <div class=\"api-body\">\n \n <section class=\"short-description\">\n <p>Configures <code>HttpClientTestingBackend</code> as the <code><a href=\"api/common/http/HttpBackend\" class=\"code-anchor\">HttpBackend</a></code> used by <code><a href=\"api/common/http/HttpClient\" class=\"code-anchor\">HttpClient</a></code>.</p>\n\n <p><a href=\"api/common/http/testing/HttpClientTestingModule#description\">See more...</a></p>\n </section>\n \n \n \n <section class=\"ngmodule-overview\">\n<code-example language=\"ts\" hidecopy=\"true\">\nclass <a href=\"api/common/http/testing/HttpClientTestingModule\" class=\"code-anchor\">HttpClientTestingModule</a> {\n}\n</code-example>\n\n \n \n\n</section>\n\n\n \n\n \n \n \n<section class=\"description\">\n <h2 id=\"description\">Description<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/http/testing/HttpClientTestingModule#description\"><i class=\"material-icons\">link</i></a></h2>\n <p>Inject <code><a href=\"api/common/http/testing/HttpTestingController\" class=\"code-anchor\">HttpTestingController</a></code> to expect and flush requests in your tests.</p>\n\n \n</section>\n\n \n\n \n\n \n\n \n\n\n \n\n\n \n \n<section class=\"providers\">\n <h2 id=\"providers\">Providers<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/http/testing/HttpClientTestingModule#providers\"><i class=\"material-icons\">link</i></a></h2>\n <table class=\"is-full-width list-table property-table\">\n <thead>\n <tr>\n <th>Provider</th>\n </tr>\n </thead>\n <tbody>\n \n <tr>\n <td>\n <code-example language=\"ts\" hidecopy=\"true\" class=\"no-box\">\n HttpClientTestingBackend\n </code-example>\n </td>\n </tr>\n \n <tr>\n <td>\n <code-example language=\"ts\" hidecopy=\"true\" class=\"no-box\">\n { provide: <a href=\"api/common/http/HttpBackend\" class=\"code-anchor\">HttpBackend</a>, useExisting: HttpClientTestingBackend }\n </code-example>\n </td>\n </tr>\n \n <tr>\n <td>\n <code-example language=\"ts\" hidecopy=\"true\" class=\"no-box\">\n { provide: <a href=\"api/common/http/testing/HttpTestingController\" class=\"code-anchor\">HttpTestingController</a>, useExisting: HttpClientTestingBackend }\n </code-example>\n </td>\n </tr>\n \n </tbody>\n </table>\n </section>\n\n \n\n \n \n\n\n \n\n\n </div>\n</article>\n\n<!-- links to this doc:\n - api/common/http/testing\n - guide/http\n - guide/testing-services\n - guide/upgrade\n-->\n<!-- links from this doc:\n - /api\n - api/common\n - api/common/http/HttpBackend\n - api/common/http/HttpClient\n - api/common/http/testing\n - api/common/http/testing/HttpClientTestingModule#description\n - api/common/http/testing/HttpClientTestingModule#httpclienttestingmodule\n - api/common/http/testing/HttpClientTestingModule#providers\n - api/common/http/testing/HttpTestingController\n - https://github.com/angular/angular/edit/master/packages/common/http/testing/src/module.ts?message=docs(common)%3A%20describe%20your%20change...#L14-L34\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/http/testing/src/module.ts#L14-L34\n-->"
}