angular-providers专题提供angular-providers的最新资讯内容,帮你更好的了解angular-providers。
我有一个库,其中有一个模块和两个组件。其中一个组件需要使用服务(并传入了一个配置-在将服务添
我必须测试一个组件并得到此错误NullInjectorError:R3InjectorError(DynamicTestModule)[AuthenticationService-> Router->
我在<strong> AppModule </strong> 导入<strong> RecruiterAdminChatsComponent </strong> <pre><code>import { NgModule } from &#39;@an
我在我的组件中经常使用 <code>ControlValueAccessor</code> 接口。要使其工作,您需要将 <code>NG_VALUE_ACCESSOR</code
我在我的项目中创建了一个组件和服务。根据使用服务时的文档,您应该将其包含在您要注入它的组件
我想弄清楚如何在 Angular 11 中使用 <strong>useFactory</strong> 作为异步函数。现在我有这个: <pre class="lang
我正在尝试在 Angular 中创建一个授权库 一个基本的例子是这个抽象类,它将在授权库中: <pre><c
我的服务 1 依赖于其他服务 2。 Service2 在其构造函数中有一个参数。 像这样在service1的构造函
我想实现一项服务,让它只提供给一个命名的组件或模块,而不提供给任何其他组件或模块。 因此
自定义表单控件使用ControlValueAccessor时需要添加forwardRef吗? 我发现它在没有它的情况下也能工作,因为
<pre><code>export const FormatDate = new InjectionToken(&#39;FormatDate&#39;); ... @Component({ selector: &#39;...&#39;, templateUrl: &#
<a href="https://i.stack.imgur.com/Z6gvL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Z6gvL.png" alt="enter image d
在基于价值的提供者(代币)中,我们有这样的东西(在模块中): <pre><code>const CONFIG = &#39;CONFIG&#39;
考虑以下代码段。如何访问 <code>Environment</code> 中提供的 <code>forRoot</code> 值?有没有其他方法可以让我
是否可以将提供者从视图组件“传递”到内容组件? 我一遍又一遍地面临这个问题,既找不到解决
我将服务移到单独的 npm 包中。虽然服务被标记为提供 在根注入器中,当我尝试在我的应用程序中使用
我有一个带有提供程序的组件的库,就像这样- <pre><code>@Component({ selector: &#34;lib-layer-list-widget&#34;,
我的意图是使用另一个管道 (DynamicPipe) 中的一个管道 (LanguagePipe): <pre><code>0</code></pre> 效果很好。