mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-14 17:53:11 +00:00
parent
0a45bff472
commit
98e18a64aa
1 changed files with 11 additions and 11 deletions
|
|
@ -20,7 +20,7 @@ allow a user to enter data.
|
||||||
$scope.zip = /^\d\d\d\d\d$/;
|
$scope.zip = /^\d\d\d\d\d$/;
|
||||||
|
|
||||||
$scope.addContact = function() {
|
$scope.addContact = function() {
|
||||||
$scope.user.contacts.push({type:'', value:''});
|
$scope.user.contacts.push({type:'email', value:''});
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.removeContact = function(contact) {
|
$scope.removeContact = function(contact) {
|
||||||
|
|
@ -34,16 +34,16 @@ allow a user to enter data.
|
||||||
</script>
|
</script>
|
||||||
<div ng-controller="FormController" class="example">
|
<div ng-controller="FormController" class="example">
|
||||||
|
|
||||||
<label>Name:</label><br/>
|
<label>Name:</label><br>
|
||||||
<input type="text" ng-model="user.name" required/> <br/><br/>
|
<input type="text" ng-model="user.name" required/> <br><br>
|
||||||
|
|
||||||
<label>Address:</label><br/>
|
<label>Address:</label><br>
|
||||||
<input type="text" ng-model="user.address.line1" size="33" required> <br/>
|
<input type="text" ng-model="user.address.line1" ng-model-instant size="33" required> <br>
|
||||||
<input type="text" ng-model="user.address.city" size="12" required>,
|
<input type="text" ng-model="user.address.city" ng-model-instant size="12" required>,
|
||||||
<input type="text" ng-model="user.address.state" size="2"
|
<input type="text" ng-model="user.address.state" ng-model-instant
|
||||||
ng-pattern="state" required>
|
ng-pattern="state" size="2" required>
|
||||||
<input type="text" ng-model="user.address.zip" size="5"
|
<input type="text" ng-model="user.address.zip" size="5"
|
||||||
ng-pattern="zip" required><br/><br/>
|
ng-pattern="zip" required><br><br>
|
||||||
|
|
||||||
<label>Phone:</label>
|
<label>Phone:</label>
|
||||||
[ <a href="" ng-click="addContact()">add</a> ]
|
[ <a href="" ng-click="addContact()">add</a> ]
|
||||||
|
|
@ -54,12 +54,12 @@ allow a user to enter data.
|
||||||
<option>pager</option>
|
<option>pager</option>
|
||||||
<option>IM</option>
|
<option>IM</option>
|
||||||
</select>
|
</select>
|
||||||
<input type="text" ng-model="contact.value" required/>
|
<input type="text" ng-model="contact.value" ng-model-instant required/>
|
||||||
[ <a href="" ng-click="removeContact(contact)">X</a> ]
|
[ <a href="" ng-click="removeContact(contact)">X</a> ]
|
||||||
</div>
|
</div>
|
||||||
<hr/>
|
<hr/>
|
||||||
Debug View:
|
Debug View:
|
||||||
<pre>user={{user}}</pre>
|
<pre>user={{user | json}}</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</doc:source>
|
</doc:source>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue