Я использую Anuglar6 и Nativescript, пытаясь показать ActivityIndicator, когда я работаю с API (логин). Это работает нормально, но после того, как я установил для логической обработки значение false, анимация вращения по-прежнему отображается.
<StackLayout class="container">
<StackLayout class="form">
<Label class="h3 lbl" text="Användarnamn:" textWrap="true"></Label>
<TextField class="field input input-border" [isEnabled]="!processing" keyboardType="email" autocapitalizationType="none" (textChange)="setUsername($event)" (returnPress)="focusPassword()"></TextField>
<Label class="h3 lbl" text="Lösenord:" textWrap="true"></Label>
<TextField #password class="field input input-border" [isEnabled]="!processing" secure="true" autocapitalizationType="none" (textChange)="setPassword($event)"></TextField>
<Button class="loginBtn" text="LOGGA IN" [isEnabled]="!processing" (tap)="submit()"></Button>
<ActivityIndicator row="1" [busy]="processing" width="100" height="100" class="activity-indicator"></ActivityIndicator>
</StackLayout>
</StackLayout>
private processing = false;
public login(): void {
this.processing = true;
this.authService.login(this.username, this.password)
.subscribe(
() => {
console.log(this.processing);
this.processing = false;
console.log(this.processing);
// this.router.navigate(['home']);
});
}
Распечатка console.log
JS: true
JS: false
Что я здесь делаю неправильно?
processing
? - person mast3rd3mon   schedule 10.12.2018visible
, и если вы используете angular, удалите теги<Page>
- person mast3rd3mon   schedule 10.12.2018[visibility]="processing ? 'visible' : 'hidden'"
? Но ActivityIndicator, кажется, не показывает только это? Кажется, нужно показать свойство[busy]
? - person Johannes Kraft   schedule 10.12.2018