Commit c6b7cce5 authored by 神楽坂玲奈's avatar 神楽坂玲奈

server select

parent 9d1505fc
...@@ -41,6 +41,7 @@ import * as Raven from 'raven-js'; ...@@ -41,6 +41,7 @@ import * as Raven from 'raven-js';
import { DecksComponent } from './decks/decks.component'; import { DecksComponent } from './decks/decks.component';
import { ConfirmDialogComponent } from './confirm-dialog/confirm-dialog.component'; import { ConfirmDialogComponent } from './confirm-dialog/confirm-dialog.component';
import { LogoutDialogComponent } from './logout-dialog/logout-dialog.component'; import { LogoutDialogComponent } from './logout-dialog/logout-dialog.component';
import { ServerSelectComponent } from './server-select/server-select.component';
export class RavenErrorHandler implements ErrorHandler { export class RavenErrorHandler implements ErrorHandler {
handleError(err: any): void { handleError(err: any): void {
...@@ -69,7 +70,8 @@ if (environment.production) { ...@@ -69,7 +70,8 @@ if (environment.production) {
ResultDialogComponent, ResultDialogComponent,
DecksComponent, DecksComponent,
ConfirmDialogComponent, ConfirmDialogComponent,
LogoutDialogComponent LogoutDialogComponent,
ServerSelectComponent
], ],
imports: [ imports: [
BrowserModule, BrowserModule,
......
mat-form-field {
width: 80px;
}
mat-select::ng-deep .mat-select-arrow-wrapper {
transform: initial;
}
mat-form-field::ng-deep .mat-form-field-underline {
display: none;
}
mat-form-field::ng-deep .mat-form-field-wrapper, mat-form-field::ng-deep .mat-form-field-flex {
padding: initial;
}
mat-form-field::ng-deep .mat-form-field-infix {
padding: initial;
border: initial;
}
环境: <mat-form-field appearance='standard'>
<!-- <mat-label>Favorite food</mat-label>-->
<mat-select>
<mat-option *ngFor='let server of servers' [value]='server.id'>
{{server.name}}
</mat-option>
</mat-select>
</mat-form-field>
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-server-select',
templateUrl: './server-select.component.html',
styleUrls: ['./server-select.component.css']
})
export class ServerSelectComponent implements OnInit {
servers = [{ id: 'mycard', name: '标准' }, { id: 'test', name: '测试' }];
constructor() {
}
ngOnInit() {
}
}
...@@ -2,3 +2,7 @@ button { ...@@ -2,3 +2,7 @@ button {
margin-left: -8px; margin-left: -8px;
margin-right: 24px; margin-right: 24px;
} }
span {
flex: 1
}
...@@ -3,4 +3,5 @@ ...@@ -3,4 +3,5 @@
<mat-icon>arrow_back</mat-icon> <mat-icon>arrow_back</mat-icon>
</button> </button>
<span><ng-content></ng-content></span> <span><ng-content></ng-content></span>
<app-server-select></app-server-select>
</mat-toolbar> </mat-toolbar>
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