mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(text-input): fix floating labels by getting the value of the ngControl if it exists
Added some test cases for this to the floating labels example. Closes #710
This commit is contained in:
@@ -4,4 +4,12 @@ import {App} from 'ionic/ionic';
|
||||
@App({
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
class E2EApp {}
|
||||
class E2EApp {
|
||||
constructor() {
|
||||
this.myValues = {
|
||||
value1: 'Dynamic Input',
|
||||
value2: 'Dynamic Textarea'
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,10 +8,11 @@
|
||||
|
||||
<ion-input floating-label>
|
||||
<ion-label>Floating Label 1</ion-label>
|
||||
<input type="text">
|
||||
<input [(ng-model)]='myValues.value1' type="text">
|
||||
</ion-input>
|
||||
Value: {{ myValues.value1 }}
|
||||
|
||||
<ion-input floating-label class="input-has-value">
|
||||
<ion-input floating-label>
|
||||
<ion-label>Floating Label 2</ion-label>
|
||||
<input value="Has Value" type="text">
|
||||
</ion-input>
|
||||
@@ -23,8 +24,9 @@
|
||||
|
||||
<ion-input floating-label>
|
||||
<ion-label primary>Floating Label 4</ion-label>
|
||||
<textarea></textarea>
|
||||
<textarea [(ng-model)]='myValues.value2'></textarea>
|
||||
</ion-input>
|
||||
Value: {{ myValues.value2 }}
|
||||
|
||||
<ion-input floating-label>
|
||||
<ion-label secondary>Floating Label 5</ion-label>
|
||||
|
||||
Reference in New Issue
Block a user