akveo / akveo/ngx-admin-bundle-support

NullInjectorError: No provider for NbAuthStrategy!

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

説明

I'm trying to set up a demo from ngx-admin Angular Frontend by following the instructions with the following code:

```
/*
* Copyright (c) Akveo 2019. All Rights Reserved.
* Licensed under the Single Application / Multi Application License.
* See LICENSE_SINGLE_APP / LICENSE_MULTI_APP in the 'docs' folder for license information on type of purchased license.
*/
import { Component, OnInit } from '@angular/core';
import { NbAuthStrategy, NbAuthToken, NbTokenStorage } from '@nebular/auth';
import { environment } from '../environments/environment';
import { AnalyticsService } from './@core/utils';

@Component({
selector: 'ngx-app',
template: '',
})
export class AppComponent implements OnInit {
constructor(private analytics: AnalyticsService,
private authStrategy: NbAuthStrategy,
private tokenStorage: NbTokenStorage) {
// this.initTestUserToken();
}

ngOnInit(): void {
this.analytics.trackPageViews();
}

initTestUserToken() {
const demoTokenInitKey = 'demo_token_initialized';
const demoTokenWasInitialized = localStorage.getItem(demoTokenInitKey);
const currentToken = this.tokenStorage.get();
if (!demoTokenWasInitialized && !currentToken.isValid()) {
// local storage is clear, let's setup demo user token for better demo experience
this.tokenStorage.set(this.authStrategy.createToken(environment.testUser.token));
localStorage.setItem(demoTokenInitKey, 'true');
}
}
}
```

However, l've been getting this error when running it locally:

![image](https://user-images.githubusercontent.com/68965410/118701656-d0d69c80-b7c8-11eb-937d-593f7cda21a1.png)

Is there anything I'm missing from the code?

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

このリポジトリのコントリビューションガイドは索引されていません

評価

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

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

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