angular-ui / angular-ui/ui-router

Angular: StateService injected in custom library results in R3InjectorError

オープン
#3,854 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
TypeScript
スター
13.4k
フォーク
2.9k
PR マージ指標
30日以内にマージされた PR はありません

説明

This issue tracker is for Bug Reports and Feature Requests only.

Please direct requests for help to StackOverflow.
See http://bit.ly/UIR-SOF for details.

This is a (check one box):

- [x ] Bug Report
- [ ] Feature Request
- [ ] General Query

My version of UI-Router is: (type version)
@uirouter/angular: 10.0.0
@uirouter/core: 6.0.8
@uirouter/rx: 1.0.0

# Bug Report

#### Current Behavior:
I am injecting the StateService in a component of a custom angular library I am building. As soon as I do that though, the following happens:

```
R3InjectorError(AppModule)[StateService -> StateService -> StateService]:
NullInjectorError: No provider for StateService!
```
and the whole app does not work.

#### Expected Behavior:
No error, being able to use the Service and not crashing the whole application.

#### Link to Plunker or stackblitz that reproduces the issue:
Github-Repo: https://github.com/Vortilion/angular-library-stateservice-issue

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。