Commit 09e4f886 authored by 神楽坂玲奈's avatar 神楽坂玲奈

lint & update

Signed-off-by: 神楽坂玲奈's avatarzh99998 <zh99998@gmail.com>
parent ec931392
This diff is collapsed.
...@@ -7,42 +7,41 @@ ...@@ -7,42 +7,41 @@
"start": "ng serve --base-href /mobile/ --deploy-url /mobile --locale zh-CN --output-path mobile --open", "start": "ng serve --base-href /mobile/ --deploy-url /mobile --locale zh-CN --output-path mobile --open",
"start:wild": "npm run start -- --host 0.0.0.0 --public-host 192.168.1.131:4200", "start:wild": "npm run start -- --host 0.0.0.0 --public-host 192.168.1.131:4200",
"build": "ng build --base-href /mobile/ --locale zh-CN --aot --build-optimizer --extract-css --prod", "build": "ng build --base-href /mobile/ --locale zh-CN --aot --build-optimizer --extract-css --prod",
"postinstall": "./fuck.sh",
"build:dev": "ng build --base-href /mobile2/ --locale zh-CN --aot --build-optimizer --extract-css", "build:dev": "ng build --base-href /mobile2/ --locale zh-CN --aot --build-optimizer --extract-css",
"lint": "ng lint", "lint": "ng lint --type-check --fix",
"publish": "npm run build && ./ossutil cp -rf dist oss://mycard/mobile", "publish": "npm run build && ./ossutil cp -rf dist oss://mycard/mobile",
"publish:dev": "npm run build:dev && ./ossutil cp -rf dist oss://mycard/mobile2" "publish:dev": "npm run build:dev && ./ossutil cp -rf dist oss://mycard/mobile2"
}, },
"dependencies": { "dependencies": {
"@angular/animations": "^4.3.0", "@angular/animations": "^4.3.6",
"@angular/cdk": "^2.0.0-beta.8", "@angular/cdk": "^2.0.0-beta.8",
"@angular/common": "^4.2.4", "@angular/common": "^4.3.6",
"@angular/compiler": "^4.2.4", "@angular/compiler": "^4.3.6",
"@angular/core": "^4.2.4", "@angular/core": "^4.3.6",
"@angular/forms": "^4.2.4", "@angular/forms": "^4.3.6",
"@angular/http": "^4.2.4", "@angular/http": "^4.3.6",
"@angular/material": "^2.0.0-beta.8", "@angular/material": "^2.0.0-beta.8",
"@angular/platform-browser": "^4.2.4", "@angular/platform-browser": "^4.3.6",
"@angular/platform-browser-dynamic": "^4.2.4", "@angular/platform-browser-dynamic": "^4.3.6",
"@angular/router": "^4.2.4", "@angular/router": "^4.3.6",
"core-js": "^2.4.1", "core-js": "^2.5.0",
"font-awesome": "^4.7.0", "font-awesome": "^4.7.0",
"hammerjs": "^2.0.8", "hammerjs": "^2.0.8",
"lodash": "^4.17.4", "lodash": "^4.17.4",
"material-design-icons": "^3.0.1", "material-design-icons": "^3.0.1",
"rxjs": "^5.4.2", "rxjs": "^5.4.3",
"webdav": "^1.0.0-rc1", "webdav": "^1.0.1",
"zone.js": "^0.8.14" "zone.js": "^0.8.17"
}, },
"devDependencies": { "devDependencies": {
"@angular/cli": "1.3.0-rc.1", "@angular/cli": "1.3.0-rc.1",
"@angular/compiler-cli": "^4.2.4", "@angular/compiler-cli": "^4.3.6",
"@angular/language-service": "^4.2.4", "@angular/language-service": "^4.3.6",
"@angular/service-worker": "^1.0.0-beta.16", "@angular/service-worker": "^1.0.0-beta.16",
"@types/lodash": "^4.14.70", "@types/lodash": "^4.14.74",
"@types/node": "^8.0.13", "@types/node": "^8.0.24",
"codelyzer": "~3.1.1", "codelyzer": "~3.1.1",
"tslint": "^5.5.0", "tslint": "^5.6.0",
"typescript": "~2.3.3" "typescript": "~2.3.3"
} }
} }
...@@ -28,9 +28,9 @@ import 'rxjs/Rx'; ...@@ -28,9 +28,9 @@ import 'rxjs/Rx';
import { AppRoutingModule } from './app-routing.module'; import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
import { LobbyComponent } from './lobby/lobby.component'; import { LobbyComponent } from './lobby/lobby.component';
import { MatchDialog } from './match/match.component'; import { MatchDialogComponent } from './match/match.component';
import { NewRoomComponent } from './new-room/new-room.component'; import { NewRoomComponent } from './new-room/new-room.component';
import { ResultDialog } from './result/result.dialog'; import { ResultDialogComponent } from './result/result.dialog';
import { RoomListComponent } from './room-list/room-list.component'; import { RoomListComponent } from './room-list/room-list.component';
import { StorageService } from './storage.service'; import { StorageService } from './storage.service';
import { ToolbarComponent } from './toolbar/toolbar.component'; import { ToolbarComponent } from './toolbar/toolbar.component';
...@@ -44,11 +44,11 @@ import { YGOProService } from './ygopro.service'; ...@@ -44,11 +44,11 @@ import { YGOProService } from './ygopro.service';
LobbyComponent, LobbyComponent,
NewRoomComponent, NewRoomComponent,
RoomListComponent, RoomListComponent,
MatchDialog, MatchDialogComponent,
WindbotComponent, WindbotComponent,
WatchComponent, WatchComponent,
ToolbarComponent, ToolbarComponent,
ResultDialog, ResultDialogComponent,
], ],
imports: [ imports: [
BrowserModule, BrowserModule,
...@@ -78,7 +78,7 @@ import { YGOProService } from './ygopro.service'; ...@@ -78,7 +78,7 @@ import { YGOProService } from './ygopro.service';
], ],
providers: [YGOProService, StorageService], providers: [YGOProService, StorageService],
bootstrap: [AppComponent], bootstrap: [AppComponent],
entryComponents: [MatchDialog, ResultDialog], entryComponents: [MatchDialogComponent, ResultDialogComponent],
}) })
export class AppModule { export class AppModule {
} }
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<md-icon>menu</md-icon> <md-icon>menu</md-icon>
</button> </button>
<form (submit)="search(key)"> <form (submit)="search(key)">
<input type=search placeholder="卡片搜索" name="key" [(ngModel)]="key" [mdAutocomplete]="auto" [formControl]="searchCtrl"> <input type=search placeholder="卡片搜索" name="key" [(ngModel)]="key" mdAutocomplete="auto" [formControl]="searchCtrl">
<md-autocomplete #auto="mdAutocomplete"> <md-autocomplete #auto="mdAutocomplete">
<md-option *ngFor="let card of suggestion | async" [value]="card" (onSelectionChange)="search(card)"> <md-option *ngFor="let card of suggestion | async" [value]="card" (onSelectionChange)="search(card)">
......
import { Component } from '@angular/core'; import { Component, HostBinding } from '@angular/core';
import { FormControl } from '@angular/forms'; import { FormControl } from '@angular/forms';
import { Http, Jsonp } from '@angular/http'; import { Http, Jsonp } from '@angular/http';
import { MdDialog } from '@angular/material';
import { ActivatedRoute } from '@angular/router';
import { environment } from '../../environments/environment'; import { environment } from '../../environments/environment';
import { LoginService } from '../login.service'; import { LoginService } from '../login.service';
import { MatchDialog } from '../match/match.component';
import { routerTransition2 } from '../router.animations'; import { routerTransition2 } from '../router.animations';
import { YGOProService } from '../ygopro.service';
import { StorageService } from '../storage.service'; import { StorageService } from '../storage.service';
import { YGOProService } from '../ygopro.service';
@Component({ @Component({
selector: 'app-lobby', selector: 'app-lobby',
templateUrl: 'lobby.component.html', templateUrl: 'lobby.component.html',
styleUrls: ['lobby.component.css'], styleUrls: ['lobby.component.css'],
animations: [routerTransition2], animations: [routerTransition2]
host: { '[@routerTransition2]': '' }
}) })
export class LobbyComponent { export class LobbyComponent {
@HostBinding('@routerTransition2')
animation: '';
version = environment.version; version = environment.version;
build: BuildConfig; build: BuildConfig;
searchCtrl = new FormControl(); searchCtrl = new FormControl();
suggestion = this.searchCtrl.valueChanges.filter(name => name).flatMap(name => this.jsonp.get('http://www.ourocg.cn/Suggest.aspx', { suggestion = this.searchCtrl.valueChanges.filter(name => name).flatMap(name => this.jsonp.get('http://www.ourocg.cn/Suggest.aspx', {
params: { callback: 'JSONP_CALLBACK', key: name } params: {callback: 'JSONP_CALLBACK', key: name}
}).map(response => response.json().result)); }).map(response => response.json().result));
key: string; key: string;
arena_url: string; arena_url: string;
constructor(public login: LoginService, public ygopro: YGOProService, public dialog: MdDialog, private http: Http, private jsonp: Jsonp, private route: ActivatedRoute, public storage: StorageService) { constructor(public login: LoginService,
public ygopro: YGOProService,
private http: Http,
private jsonp: Jsonp,
public storage: StorageService) {
const arena_url = new URL('https://mycard.moe/ygopro/arena'); const arena_url = new URL('https://mycard.moe/ygopro/arena');
arena_url.searchParams.set('sso', login.token); arena_url.searchParams.set('sso', login.token);
......
...@@ -11,9 +11,9 @@ export class LoginService { ...@@ -11,9 +11,9 @@ export class LoginService {
login() { login() {
let params = new URLSearchParams(); let params = new URLSearchParams();
params.set('return_sso_url', location.href); params.set('return_sso_url', location.href);
let payload = Buffer.from(params.toString()).toString('base64'); const payload = Buffer.from(params.toString()).toString('base64');
let url = new URL('https://accounts.moecube.com'); const url = new URL('https://accounts.moecube.com');
params = url['searchParams']; params = url['searchParams'];
params.set('sso', payload); params.set('sso', payload);
...@@ -48,9 +48,9 @@ export class LoginService { ...@@ -48,9 +48,9 @@ export class LoginService {
logout() { logout() {
let params = new URLSearchParams(); let params = new URLSearchParams();
params.set('return_sso_url', location.href); params.set('return_sso_url', location.href);
let payload = Buffer.from(params.toString()).toString('base64'); const payload = Buffer.from(params.toString()).toString('base64');
let url = new URL('https://accounts.moecube.com/signin'); const url = new URL('https://accounts.moecube.com/signin');
params = url['searchParams']; params = url['searchParams'];
params.set('sso', payload); params.set('sso', payload);
return url.toString(); return url.toString();
......
...@@ -13,20 +13,25 @@ const offset = new Date().getTimezoneOffset() * 60 * second; ...@@ -13,20 +13,25 @@ const offset = new Date().getTimezoneOffset() * 60 * second;
templateUrl: './match.component.html', templateUrl: './match.component.html',
styleUrls: ['./match.component.css'] styleUrls: ['./match.component.css']
}) })
export class MatchDialog implements OnInit, OnDestroy { export class MatchDialogComponent implements OnInit, OnDestroy {
expect_wait = this.http.get('https://api.mycard.moe/ygopro/match/stats/' + this.arena).map(response => response.json() * second + offset); expect_wait = this.http.get('https://api.mycard.moe/ygopro/match/stats/' + this.arena).map(response => response.json() * second + offset);
actual_wait = Observable.timer(0, second).map(timestamp => timestamp * second + offset); actual_wait = Observable.timer(0, second).map(timestamp => timestamp * second + offset);
matching: Subscription; matching: Subscription;
constructor(@Inject(MD_DIALOG_DATA) public arena: string, private dialogRef: MdDialogRef<MatchDialog>, private http: Http, private login: LoginService) { constructor(@Inject(MD_DIALOG_DATA) public arena: string,
private dialogRef: MdDialogRef<MatchDialogComponent>,
private http: Http,
private login: LoginService) {
} }
ngOnInit() { ngOnInit() {
this.matching = this.http.post('https://api.mycard.moe/ygopro/match', null, { this.matching = this.http.post('https://api.mycard.moe/ygopro/match', null, {
headers: new Headers({ Authorization: 'Basic ' + Buffer.from(this.login.user.username + ':' + this.login.user.external_id).toString('base64') }), headers: new Headers({
params: { arena: this.arena, locale: 'zh-CN' } Authorization: 'Basic ' + Buffer.from(this.login.user.username + ':' + this.login.user.external_id).toString('base64')
}),
params: {arena: this.arena, locale: 'zh-CN'}
}).map(response => response.json()).subscribe((data) => { }).map(response => response.json()).subscribe((data) => {
this.dialogRef.close(data); this.dialogRef.close(data);
}, (error) => { }, (error) => {
......
import { Component, ElementRef, ViewChild } from '@angular/core'; import { Component, ElementRef, HostBinding, ViewChild } from '@angular/core';
import { MdSnackBar } from '@angular/material'; import { MdSnackBar } from '@angular/material';
import { LoginService } from '../login.service'; import { LoginService } from '../login.service';
import { routerTransition } from '../router.animations'; import { routerTransition } from '../router.animations';
...@@ -9,11 +9,13 @@ import { YGOProService } from '../ygopro.service'; ...@@ -9,11 +9,13 @@ import { YGOProService } from '../ygopro.service';
selector: 'app-new-room', selector: 'app-new-room',
templateUrl: 'new-room.component.html', templateUrl: 'new-room.component.html',
styleUrls: ['new-room.component.css'], styleUrls: ['new-room.component.css'],
animations: [routerTransition], animations: [routerTransition]
host: { '[@routerTransition]': '' }
}) })
export class NewRoomComponent { export class NewRoomComponent {
@HostBinding('@routerTransition')
animation = '';
@ViewChild('hostPasswordInput') @ViewChild('hostPasswordInput')
hostPasswordInput: ElementRef; hostPasswordInput: ElementRef;
...@@ -22,7 +24,7 @@ export class NewRoomComponent { ...@@ -22,7 +24,7 @@ export class NewRoomComponent {
room = { room = {
title: this.login.user.username + '的房间', title: this.login.user.username + '的房间',
'private': false, 'private': false,
options: { ...this.ygopro.default_options } options: {...this.ygopro.default_options}
}; };
constructor(public ygopro: YGOProService, private login: LoginService, private snackBar: MdSnackBar) { constructor(public ygopro: YGOProService, private login: LoginService, private snackBar: MdSnackBar) {
...@@ -34,7 +36,7 @@ export class NewRoomComponent { ...@@ -34,7 +36,7 @@ export class NewRoomComponent {
this.hostPasswordInput.nativeElement.select(); this.hostPasswordInput.nativeElement.select();
if (document.execCommand('copy')) { if (document.execCommand('copy')) {
this.snackBar.open(`房间密码 ${host_password} 已复制到剪贴板`, undefined, { duration: 3000 }); this.snackBar.open(`房间密码 ${host_password} 已复制到剪贴板`, undefined, {duration: 3000});
} else { } else {
console.log('Oops, unable to copy'); console.log('Oops, unable to copy');
} }
...@@ -49,7 +51,7 @@ export class NewRoomComponent { ...@@ -49,7 +51,7 @@ export class NewRoomComponent {
} }
set_start_lp() { set_start_lp() {
if (this.room.options.mode == 2) { if (this.room.options.mode === 2) {
this.room.options.start_lp = 16000; this.room.options.start_lp = 16000;
} else { } else {
this.room.options.start_lp = 8000; this.room.options.start_lp = 8000;
......
...@@ -2,20 +2,24 @@ import { Component, Inject } from '@angular/core'; ...@@ -2,20 +2,24 @@ import { Component, Inject } from '@angular/core';
import { Http } from '@angular/http'; import { Http } from '@angular/http';
import { MD_DIALOG_DATA, MdDialog, MdDialogRef } from '@angular/material'; import { MD_DIALOG_DATA, MdDialog, MdDialogRef } from '@angular/material';
import { LoginService } from '../login.service'; import { LoginService } from '../login.service';
import { MatchDialog } from '../match/match.component'; import { MatchDialogComponent } from '../match/match.component';
@Component({ @Component({
selector: 'app-result', selector: 'app-result',
templateUrl: './result.dialog.html', templateUrl: './result.dialog.html',
styleUrls: ['./result.dialog.css'] styleUrls: ['./result.dialog.css']
}) })
export class ResultDialog { export class ResultDialogComponent {
result: 'win' | 'lose' | 'draw'; result: 'win' | 'lose' | 'draw';
dp: string | undefined; dp: string | undefined;
exp: string | undefined; exp: string | undefined;
firstWin: string | undefined; firstWin: string | undefined;
constructor(@Inject(MD_DIALOG_DATA) public last: any, public login: LoginService, private http: Http, public dialog: MdDialog, private dialogRef: MdDialogRef<MatchDialog>) { constructor(@Inject(MD_DIALOG_DATA) public last: any,
public login: LoginService,
private http: Http,
public dialog: MdDialog,
private dialogRef: MdDialogRef<MatchDialogComponent>) {
if (this.last.userscorea === this.last.userscoreb) { if (this.last.userscorea === this.last.userscoreb) {
this.result = 'draw'; this.result = 'draw';
} else if (this.last.winner === this.login.user.username) { } else if (this.last.winner === this.login.user.username) {
...@@ -24,7 +28,7 @@ export class ResultDialog { ...@@ -24,7 +28,7 @@ export class ResultDialog {
this.result = 'lose'; this.result = 'lose';
} }
const index = this.last.usernamea == this.login.user.username ? 'a' : 'b'; const index = this.last.usernamea === this.login.user.username ? 'a' : 'b';
if (this.last.isfirstwin && this.result === 'win') { if (this.last.isfirstwin && this.result === 'win') {
this.dp = this.format(this.last[`pt${index}`] - 4, this.last[`pt${index}_ex`]); this.dp = this.format(this.last[`pt${index}`] - 4, this.last[`pt${index}_ex`]);
......
import { ChangeDetectorRef, Component } from '@angular/core'; import { ChangeDetectorRef, Component, HostBinding, OnInit } from '@angular/core';
import { LoginService } from '../login.service'; import { LoginService } from '../login.service';
import { RoomListDataSource, YGOProService } from '../ygopro.service';
import { routerTransition } from '../router.animations'; import { routerTransition } from '../router.animations';
import { RoomListDataSource, YGOProService } from '../ygopro.service';
@Component({ @Component({
selector: 'app-room-list', selector: 'app-room-list',
styleUrls: ['room-list.component.css'], styleUrls: ['room-list.component.css'],
templateUrl: 'room-list.component.html', templateUrl: 'room-list.component.html',
animations: [routerTransition], animations: [routerTransition]
host: {'[@routerTransition]': ''}
}) })
export class RoomListComponent { export class RoomListComponent implements OnInit {
@HostBinding('@routerTransition')
animation: '';
displayedColumns = ['title', 'users', 'mode', 'extra']; displayedColumns = ['title', 'users', 'mode', 'extra'];
dataSource = new RoomListDataSource(this.ygopro.servers.filter(server => server.custom)); dataSource = new RoomListDataSource(this.ygopro.servers.filter(server => server.custom));
......
// // import the required animation functions from the angular animations module
// import { trigger, state, animate, transition, style } from '@angular/animations';
//
// export const slideInOutAnimation =
// // trigger name for attaching this animation to an element using the [@triggerName] syntax
// trigger('slideInOutAnimation', [
//
// // end state styles for route container (host)
// state('*', style({
// // the view covers the whole screen with a semi tranparent background
// position: 'fixed',
// top: 0,
// left: 0,
// right: 0,
// bottom: 0,
// backgroundColor: 'rgba(0, 0, 0, 0.8)'
// })),
//
// // route 'enter' transition
// transition(':enter', [
//
// // styles at start of transition
// style({
// // start with the content positioned off the right of the screen,
// // -400% is required instead of -100% because the negative position adds to the width of the element
// right: '-400%',
//
// // start with background opacity set to 0 (invisible)
// backgroundColor: 'rgba(0, 0, 0, 0)'
// }),
//
// // animation and styles at end of transition
// animate('5s ease-in-out', style({
// // transition the right position to 0 which slides the content into view
// right: 0,
//
// // transition the background opacity to 0.8 to fade it in
// backgroundColor: 'rgba(0, 0, 0, 0.8)'
// }))
// ]),
//
// // route 'leave' transition
// transition(':leave', [
// // animation and styles at end of transition
// animate('5s ease-in-out', style({
// // transition the right position to -400% which slides the content out of view
// right: '-400%',
//
// // transition the background opacity to 0 to fade it out
// backgroundColor: 'rgba(0, 0, 0, 0)'
// }))
// ])
// ]);
import { animate, state, style, transition, trigger } from '@angular/animations'; import { animate, state, style, transition, trigger } from '@angular/animations';
export const routerTransition = trigger('routerTransition', [ export const routerTransition = trigger('routerTransition', [
state('void', style({ position: 'absolute', width: '100%' })), state('void', style({position: 'absolute', width: '100%'})),
state('*', style({ position: 'absolute', width: '100%' })), state('*', style({position: 'absolute', width: '100%'})),
transition(':enter', [ // before 2.1: transition('void => *', [ transition(':enter', [ // before 2.1: transition('void => *', [
style({ transform: 'translateX(100%)' }), style({transform: 'translateX(100%)'}),
animate('.5s ease-in-out', style({ transform: 'translateX(0%)' })) animate('.5s ease-in-out', style({transform: 'translateX(0%)'}))
]), ]),
transition(':leave', [ // before 2.1: transition('* => void', [ transition(':leave', [ // before 2.1: transition('* => void', [
style({ transform: 'translateX(0%)' }), style({transform: 'translateX(0%)'}),
animate('.5s ease-in-out', style({ transform: 'translateX(100%)' })) animate('.5s ease-in-out', style({transform: 'translateX(100%)'}))
]) ])
]); ]);
export const routerTransition2 = trigger('routerTransition2', [ export const routerTransition2 = trigger('routerTransition2', [
state('void', style({ position: 'absolute', width: '100%' })), state('void', style({position: 'absolute', width: '100%'})),
state('*', style({ position: 'absolute', width: '100%' })), state('*', style({position: 'absolute', width: '100%'})),
transition(':enter', [ // before 2.1: transition('void => *', [ transition(':enter', [ // before 2.1: transition('void => *', [
style({ transform: 'translateX(-100%)' }), style({transform: 'translateX(-100%)'}),
animate('.5s ease-in-out', style({ transform: 'translateX(0%)' })) animate('.5s ease-in-out', style({transform: 'translateX(0%)'}))
]), ]),
transition(':leave', [ // before 2.1: transition('* => void', [ transition(':leave', [ // before 2.1: transition('* => void', [
style({ transform: 'translateX(0%)' }), style({transform: 'translateX(0%)'}),
animate('.5s ease-in-out', style({ transform: 'translateX(-100%)' })) animate('.5s ease-in-out', style({transform: 'translateX(-100%)'}))
]) ])
]); ]);
...@@ -4,24 +4,24 @@ import * as webdav from 'webdav'; ...@@ -4,24 +4,24 @@ import * as webdav from 'webdav';
import { LoginService } from './login.service'; import { LoginService } from './login.service';
interface DirectoryStats { interface DirectoryStats {
'filename': string, 'filename': string;
'basename': string, 'basename': string;
'lastmod': string, 'lastmod': string;
'size': 0, 'size': 0;
'type': 'directory' 'type': 'directory';
} }
interface FileStats { interface FileStats {
'filename': string, 'filename': string;
'basename': string, 'basename': string;
'lastmod': string, 'lastmod': string;
'size': number, 'size': number;
'type': 'file', 'type': 'file';
'mime': string 'mime': string;
} }
type Stats = DirectoryStats | FileStats type Stats = DirectoryStats | FileStats;
@Injectable() @Injectable()
export class StorageService { export class StorageService {
...@@ -168,7 +168,7 @@ export class StorageService { ...@@ -168,7 +168,7 @@ export class StorageService {
async * walk(dir: string): AsyncIterable<Stats> { async * walk(dir: string): AsyncIterable<Stats> {
const items: Stats[] = await this.client.getDirectoryContents(dir); const items: Stats[] = await this.client.getDirectoryContents(dir);
// console.log('取远端目录', dir, items); // console.log('取远端目录', dir, items);
for (let item of items) { for (const item of items) {
if (item.type === 'directory') { if (item.type === 'directory') {
yield* this.walk(item.filename); yield* this.walk(item.filename);
} else { } else {
......
import { ChangeDetectorRef, Component, OnInit } from '@angular/core'; import { ChangeDetectorRef, Component, HostBinding, OnInit } from '@angular/core';
import { LoginService } from '../login.service'; import { LoginService } from '../login.service';
import { RoomListDataSource, YGOProService } from '../ygopro.service';
import { routerTransition } from '../router.animations'; import { routerTransition } from '../router.animations';
import { RoomListDataSource, YGOProService } from '../ygopro.service';
@Component({ @Component({
selector: 'app-watch', selector: 'app-watch',
templateUrl: './watch.component.html', templateUrl: './watch.component.html',
styleUrls: ['./watch.component.css'], styleUrls: ['./watch.component.css'],
animations: [routerTransition], animations: [routerTransition]
host: {'[@routerTransition]': ''}
}) })
export class WatchComponent implements OnInit { export class WatchComponent implements OnInit {
@HostBinding('@routerTransition')
animation = '';
displayedColumns = ['mode', 'title', 'users', 'extra']; displayedColumns = ['mode', 'title', 'users', 'extra'];
dataSource = new RoomListDataSource(this.ygopro.servers, 'started'); dataSource = new RoomListDataSource(this.ygopro.servers, 'started');
......
import { Component } from '@angular/core'; import { Component, HostBinding } from '@angular/core';
import { LoginService } from '../login.service'; import { LoginService } from '../login.service';
import { YGOProService } from '../ygopro.service';
import { routerTransition } from '../router.animations'; import { routerTransition } from '../router.animations';
import { YGOProService } from '../ygopro.service';
@Component({ @Component({
selector: 'app-windbot', selector: 'app-windbot',
templateUrl: './windbot.component.html', templateUrl: './windbot.component.html',
styleUrls: ['./windbot.component.css'], styleUrls: ['./windbot.component.css'],
animations: [routerTransition], animations: [routerTransition]
host: {'[@routerTransition]': ''}
}) })
export class WindbotComponent { export class WindbotComponent {
@HostBinding('@routerTransition')
animation = '';
constructor(public login: LoginService, public ygopro: YGOProService) { constructor(public login: LoginService, public ygopro: YGOProService) {
} }
......
This diff is collapsed.
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
// import 'core-js/es6/reflect'; // import 'core-js/es6/reflect';
// import 'core-js/es7/reflect'; // import 'core-js/es7/reflect';
import 'core-js/shim' import 'core-js/shim';
/** /**
* Required to support Web Animations `@angular/animation`. * Required to support Web Animations `@angular/animation`.
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
} }
], ],
"no-arg": true, "no-arg": true,
"no-bitwise": true, "no-bitwise": false,
"no-console": [ "no-console": [
true, true,
"debug", "debug",
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
"ignore-params" "ignore-params"
], ],
"no-misused-new": true, "no-misused-new": true,
"no-non-null-assertion": true, "no-non-null-assertion": false,
"no-shadowed-variable": true, "no-shadowed-variable": true,
"no-string-literal": false, "no-string-literal": false,
"no-string-throw": true, "no-string-throw": true,
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
true, true,
"single" "single"
], ],
"radix": true, "radix": false,
"semicolon": [ "semicolon": [
true, true,
"always" "always"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment