【发布时间】:2016-11-21 10:53:30
【问题描述】:
我正在尝试设置输入的样式,使其具有一定的宽度。我正在使用 Angular Material 2,但由于某种原因,css 中的样式未应用于输入标签。 Here is a working plunker of my issue 以及受影响的代码:
@Component({
selector: 'my-app',
template: `
<div>
<form>
<md-input [(ngModel)]="cycleTime" type="number" name="email">
<span md-prefix>Cycle Time:</span>
<span md-suffix> minutes</span>
</md-input>
</form>
</div>
`,
styles:[`
input {
width: 50px;
text-align: right;
}
`],
directives: [MdButton, MdInput]
})
export class AppComponent {
cycleTime = 1
constructor() {}
}
如何设置由 Angular Material 2 创建的输入的样式?
【问题讨论】:
-
请帮我解决我的问题 - stackoverflow.com/questions/55691754/…
标签: angular angular2-forms angular-material2