akveo / akveo/ngx-admin-bundle-support
NullInjectorError: No provider for NbAuthStrategy!
- 主要言語
- 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:

Is there anything I'm missing from the code?
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。