1

我想從角度2材質使用md-input指令,但出現奇怪的錯誤。我完全按照說明操作,but I keep getting something that looks like this.我不知道是什麼導致佔位符下面的雙線。我搜遍了Github的問題 ,什麼都沒發現。代碼看起來是這樣的:從角度2使用md輸入時的雙行

<div class="curtain"></div> 
    <md-card class="z-depth-4"> 
    <md-card-title> 
     Login 
    </md-card-title> 
    <md-card-content class="center"> 
<md-input-container> 
    <input md-input 
    placeholder="Account Number" 
    [(ngModel)]="accountNumber"/> 
</md-input-container> 
    <br> 
<md-input-container> 
    <input md-input 
    placeholder="Username" 
    [(ngModel)]="username"/> 
</md-input-container> 
    <br> 
<md-input-container> 
    <input md-input 
    placeholder="Password" 
    type="password" 
    [(ngModel)]="password"/> 
    </md-input-container> 
</md-card-content> 
<md-card-actions> 
    <button class="btn-flat blue-text btn-large right">Login</button> 
    </md-card-actions> 
</md-card> 

任何幫助,我可以得到這將是太棒了。謝謝!

+1

我在材料什麼那麼沒有經驗。但出於好奇,我看了一下。在我看來的所有地方,''裏面都沒有用過,只是' Alex

回答

0

您的index.html上可能有多個用於角材料樣式表的條目。

確保你只有這些:

link href="https://unpkg.com/@angular/material/core/theming/prebuilt/indigo-pink.css" rel="stylesheet" 
link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" (tag symbols excluded in comment)