-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
22 additions
and
6,083 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1 @@ | ||
{ | ||
"id": "errors/NG0200", | ||
"title": "NG0200: Circular dependency in DI detected while instantiating a provider\n\nDI 在实例化服务提供者时检测到循环依赖", | ||
"contents": "<h1 id=\"ng0200-circular-dependency-in-di-detected-while-instantiating-a-provider--di-在实例化服务提供者时检测到循环依赖\">NG0200: Circular dependency in DI detected while instantiating a provider\n<br>\nDI 在实例化服务提供者时检测到循环依赖<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"errors/NG0200#ng0200-circular-dependency-in-di-detected-while-instantiating-a-provider--di-在实例化服务提供者时检测到循环依赖\"><i class=\"material-icons\">link</i></a></h1>\n<div class=\"github-links\">\n <a href=\"https://github.com/angular/angular-cn/edit/aio/aio/content/errors/NG0200.md?message=docs(...)%3A%20请简述你的修改...\" aria-label=\"提供编辑建议\" title=\"提供编辑建议\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n</div>\n\n\n<div class=\"video-container\">\n <video controls=\"\">\n <source src=\"https://videos.angular.cn/NG0200.cn.webm\" type=\"video/webm\">\n <source src=\"https://videos.angular.cn/NG0200.cn.mp4\" type=\"video/mp4\">\n <track src=\"https://videos.angular.cn/NG0200.cn.en.vtt\" label=\"English\" kind=\"subtitles\" srclang=\"en\">\n <track src=\"https://videos.angular.cn/NG0200.cn.cn.vtt\" label=\"简体中文\" kind=\"subtitles\" srclang=\"zh-CN\" default=\"\">\n <track src=\"https://videos.angular.cn/NG0200.cn.tw.vtt\" label=\"正體中文\" kind=\"subtitles\" srclang=\"zh-TW\">\n</video>\n\n\n\n<div class=\"content\">\n <h2 translation-result=\"on\" id=\"说明\">说明<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"errors/NG0200#说明\"><i class=\"material-icons\">link</i></a></h2>\n <h2 translation-origin=\"off\" id=\"description\">Description<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"errors/NG0200#description\"><i class=\"material-icons\">link</i></a></h2>\n <p translation-result=\"on\">当某个<a href=\"guide/hierarchical-dependency-injection\">服务的依赖项</a>直接或间接依赖于此服务本身时,便存在循环依赖项。比如,如果 <code>UserService</code> 依赖于 <code>EmployeeService</code> ,而 <code>EmployeeService</code> 也依赖于 <code>UserService</code>。 Angular 将不得不先实例化 <code>EmployeeService</code> 再创建 <code>UserService</code>,而 <code>EmployeeService</code> 又依赖于 <code>UserService</code> 本身。</p><p translation-origin=\"off\">A cyclic dependency exists when a <a href=\"guide/hierarchical-dependency-injection\">dependency of a service</a> directly or indirectly depends on the service itself. For example, if <code>UserService</code> depends on <code>EmployeeService</code>, which also depends on <code>UserService</code>. Angular will have to instantiate <code>EmployeeService</code> to create <code>UserService</code>, which depends on <code>UserService</code>, itself.</p>\n\n\n</div>\n<br>\n<div class=\"debugging\">\n <h2 translation-result=\"on\" id=\"如何排除本错误\">如何排除本错误<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"errors/NG0200#如何排除本错误\"><i class=\"material-icons\">link</i></a></h2>\n <h2 translation-origin=\"off\" id=\"debugging-the-error\">Debugging the error<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"errors/NG0200#debugging-the-error\"><i class=\"material-icons\">link</i></a></h2>\n <p translation-result=\"on\">使用调用栈来确定循环依赖项存在的位置。通过<a href=\"guide/dependency-injection-in-action\">源码映射找出</a>组件、模块或服务的依赖项,并找出导致此问题的循环,你将能够查看是否有任何子依赖项依赖于原始文件。</p><p translation-result=\"on\">打破依赖关系的这种循环以解决此错误。这通常意味着删除或重构依赖项以使其彼此不互相依赖。</p><p translation-origin=\"off\">Use the call stack to determine where the cyclical dependency exists. You will be able to see if any child dependencies rely on the original file by <a href=\"guide/dependency-injection-in-action\">mapping out</a> the component, module, or service’s dependencies and identify the loop causing the problem.</p>\n\n<p translation-origin=\"off\">Break this loop (or circle) of dependency to resolve this error. This most commonly means removing or refactoring the dependencies to not be reliant on one another.</p>\n\n\n</div>\n\n\n<!-- links to this doc:\n - errors\n-->\n<!-- links from this doc:\n - errors/NG0200#debugging-the-error\n - errors/NG0200#description\n - errors/NG0200#ng0200-circular-dependency-in-di-detected-while-instantiating-a-provider--di-在实例化服务提供者时检测到循环依赖\n - errors/NG0200#如何排除本错误\n - errors/NG0200#说明\n - guide/dependency-injection-in-action\n - guide/hierarchical-dependency-injection\n - https://github.com/angular/angular-cn/edit/aio/aio/content/errors/NG0200.md?message=docs(...)%3A%20请简述你的修改...\n-->" | ||
} | ||
{"id":"errors/NG0200","title":"NG0200: Circular dependency in DI detected while instantiating a provider\n\nDI 在实例化服务提供者时检测到循环依赖","contents":"<h1 id=\"ng0200-circular-dependency-in-di-detected-while-instantiating-a-provider--di-在实例化服务提供者时检测到循环依赖\">NG0200: Circular dependency in DI detected while instantiating a provider\n<br>\nDI 在实例化服务提供者时检测到循环依赖<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"errors/NG0200#ng0200-circular-dependency-in-di-detected-while-instantiating-a-provider--di-在实例化服务提供者时检测到循环依赖\"><i class=\"material-icons\">link</i></a></h1>\n<div class=\"github-links\">\n <a href=\"https://github.com/angular/angular-cn/edit/aio/aio/content/errors/NG0200.md?message=docs(...)%3A%20请简述你的修改...\" aria-label=\"提供编辑建议\" title=\"提供编辑建议\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n</div>\n\n\n<div class=\"video-container\">\n <video controls>\n <source src=\"https://videos.angular.cn/NG0200.cn.webm\" type=\"video/webm\">\n <source src=\"https://videos.angular.cn/NG0200.cn.mp4\" type=\"video/mp4\">\n <track src=\"NG0200.cn.en.vtt\" label=\"English\" kind=\"subtitles\" srclang=\"en\">\n <track src=\"NG0200.cn.cn.vtt\" label=\"简体中文\" kind=\"subtitles\" srclang=\"zh-CN\" default>\n <track src=\"NG0200.cn.tw.vtt\" label=\"正體中文\" kind=\"subtitles\" srclang=\"zh-TW\">\n</video>\n\n\n\n<div class=\"content\">\n <h2 translation-result=\"on\" id=\"说明\">说明<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"errors/NG0200#说明\"><i class=\"material-icons\">link</i></a></h2>\n <h2 translation-origin=\"off\" id=\"description\">Description<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"errors/NG0200#description\"><i class=\"material-icons\">link</i></a></h2>\n <p translation-result=\"on\">当某个<a href=\"guide/hierarchical-dependency-injection\">服务的依赖项</a>直接或间接依赖于此服务本身时,便存在循环依赖项。比如,如果 <code>UserService</code> 依赖于 <code>EmployeeService</code> ,而 <code>EmployeeService</code> 也依赖于 <code>UserService</code>。 Angular 将不得不先实例化 <code>EmployeeService</code> 再创建 <code>UserService</code>,而 <code>EmployeeService</code> 又依赖于 <code>UserService</code> 本身。</p><p translation-origin=\"off\">A cyclic dependency exists when a <a href=\"guide/hierarchical-dependency-injection\">dependency of a service</a> directly or indirectly depends on the service itself. For example, if <code>UserService</code> depends on <code>EmployeeService</code>, which also depends on <code>UserService</code>. Angular will have to instantiate <code>EmployeeService</code> to create <code>UserService</code>, which depends on <code>UserService</code>, itself.</p>\n\n\n</div>\n<br>\n<div class=\"debugging\">\n <h2 translation-result=\"on\" id=\"如何排除本错误\">如何排除本错误<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"errors/NG0200#如何排除本错误\"><i class=\"material-icons\">link</i></a></h2>\n <h2 translation-origin=\"off\" id=\"debugging-the-error\">Debugging the error<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"errors/NG0200#debugging-the-error\"><i class=\"material-icons\">link</i></a></h2>\n <p translation-result=\"on\">使用调用栈来确定循环依赖项存在的位置。通过<a href=\"guide/dependency-injection-in-action\">源码映射找出</a>组件、模块或服务的依赖项,并找出导致此问题的循环,你将能够查看是否有任何子依赖项依赖于原始文件。</p><p translation-result=\"on\">打破依赖关系的这种循环以解决此错误。这通常意味着删除或重构依赖项以使其彼此不互相依赖。</p><p translation-origin=\"off\">Use the call stack to determine where the cyclical dependency exists. You will be able to see if any child dependencies rely on the original file by <a href=\"guide/dependency-injection-in-action\">mapping out</a> the component, module, or service’s dependencies and identify the loop causing the problem.</p>\n\n<p translation-origin=\"off\">Break this loop (or circle) of dependency to resolve this error. This most commonly means removing or refactoring the dependencies to not be reliant on one another.</p>\n\n\n</div>\n\n\n<!-- links to this doc:\n - errors\n-->\n<!-- links from this doc:\n - errors/NG0200#debugging-the-error\n - errors/NG0200#description\n - errors/NG0200#ng0200-circular-dependency-in-di-detected-while-instantiating-a-provider--di-在实例化服务提供者时检测到循环依赖\n - errors/NG0200#如何排除本错误\n - errors/NG0200#说明\n - guide/dependency-injection-in-action\n - guide/hierarchical-dependency-injection\n - https://github.com/angular/angular-cn/edit/aio/aio/content/errors/NG0200.md?message=docs(...)%3A%20请简述你的修改...\n-->"} |
Oops, something went wrong.