ng-ytl-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
33 lines (29 loc) • 852 B
text/typescript
import { Component } from '@angular/core';
const UserList = ['U', 'Lucy', 'Tom', 'Edward'];
const ColorList = ['#f56a00', '#7265e6', '#ffbf00', '#00a2ae'];
export class NzDemoAvatarAutoSizeComponent {
text: string = UserList[3];
color: string = ColorList[3];
change() {
let idx = UserList.indexOf(this.text);
++idx;
if (idx == UserList.length) idx = 0;
this.text = UserList[idx];
this.color = ColorList[idx];
}
}