我试图在LoginService中注入AccountService,但不会这样做,accountService未定义,但另一方面authServiceProvider已定义。
相反,它完美地注入了footerComponent中。
那么,为什么将AccountService完美地注入FooterComponent并导致LoginService出错。
我不知道问题出在哪里。
import { Injectable } from '@angular/core';
import { AccountService } from 'app/core/auth/account.service';
import { AuthServerProvider } from 'app/core/auth/auth-jwt.service';
@Injectable({ providedIn: 'root' })
export class LoginService {
constructor(public accountService: AccountService, private authServerProvider: AuthServerProvider) {
console.log(this.accountService); // is undefined
console.log(this.authServerProvider); // is defined
}
Run Code Online (Sandbox Code Playgroud)
这是AuthentificationService
@Injectable({ providedIn: 'root' })
export class AuthServerProvider {
constructor(private http: HttpClient, private $localStorage: LocalStorageService, private $sessionStorage: SessionStorageService) {}
Run Code Online (Sandbox Code Playgroud)
这是AccountService
@Injectable({ providedIn: 'root' })
export class AccountService {
private userIdentity: any;
private authenticated = …Run Code Online (Sandbox Code Playgroud) dependency-injection typescript ecmascript-6 jhipster angular
我使用此代码从 url 显示图像,它可以工作,但图像存储在设备中,这是问题所在,因为我只想在用户连接到互联网时显示此图像
ImageView imageView=(ImageView) findViewById(R.id.imageView3);
image = BitmapFactory.decodeStream(url.openConnection().getInputStream());
imageView.setImageBitmap(bitmap);
Run Code Online (Sandbox Code Playgroud)
如何在 Android 中显示来自 URL 的图像?
在我运行我的应用程序后,我在RecyclerView项目之间获得了很大的差距!这是我的代码:Github recyclerview项目之间的差距很大
android ×2
angular ×1
ecmascript-6 ×1
https ×1
image ×1
jhipster ×1
typescript ×1
url ×1
xml ×1