2016-12-05 9 views
0

私はイオンフレームワークを初めて使っています。入力タイプのボタンを入力すると、ページの一番下に行くようになりました。どのようにこれらのエラーを克服することができます。以下 は私のコードです:ionic2を使用して入力値を取得する方法は?

以下
<ion-header></ion-header> 
<ion-content padding> 
    <h2></h2> 
    <div> 
     <img class="displayed" style="height:100px; width:100px text-align: center;" src="assets/img/logo.png"> 
     <h2>Forgot Password</h2> 
    </div> 
    <p class="side" style= "margin-top:90px; color:grey; font-size:18px; font-family:'Arial', Helvetica, sans-serif">Enter the Phone number associated with your account, and we'll send an OTP to reset your password</p> 
<ion-item> 
    <ion-label stacked>PHONE</ion-label> 
    <ion-input type="number" value="" ></ion-input> 
<input type="number" placeholder="8121218820" ng-model="data.number" 
required> 
    </ion-item> 
    <button ion-button color="secondary" round>SEND OTP</button> 
</ion-content> 

は、私の画面イメージである: enter image description here

+0

どういう意味ですか? "これはあなたの問題は、ページの下部に行く入力タイプのボタンを入力していたときは"ですか?または、「ionic2を使用して入力値を取得する方法」ですか?これは問題?そして何が「エラー」なのですか? – Ivaro18

答えて

0

あなたは

を使用している場合、私は本当にあなたの質問が、

が、上記のコードでは理解していませんでした

<ion-input type="number" value="" ></ion-input> 

なぜ入力タイプ= "番号"プレースホルダ= "8121218820" ng-model = "data.number"を再度使用していますか 必要>

何でそのことについてのほかに、あなたはまた、一緒にも、フィールド値のデフォルト値の設定

そのないNG-モデル

<ion-input type="number" [(ngModel)]="data.number"></ion-input> 

をangular2を使用しているionic2使用している場合は、すべてのionviewdidload関数またはビューに含まれていないコンストラクタ内

関連する問題