当用户按下" Spin"应用程序循环通过图像并选择随机图像。我必须设置一个间隔,这样你就可以在找到随机图像之前看到它们。所以它看起来像是在旋转。
以下是代码:
import { Component } from 'angular2/core';
import { Router } from 'angular2/router';
import { UserService } from '../services/user.service';
@Component({
selector: 'login',
template: 'client/dev/user/templates/login.html',
styleUrls: ['client/dev/todo/styles/todo.css'],
providers: []
})
export class LoginComponent {
constructor(
private userService: UserService,
private router: Router
) { }
onSubmit(email, password) {
this.userService.login(email, password).subscribe((result) => {
if (result) {
this.router.navigate(['Home']);
}
});
}
}