任何人都可以請告訴我如何從表單字段檢索名字和姓氏的值。 條件是名字和姓氏被寫在相同的文本字段中,並由" "
(空格)分隔。我需要得到它的價值。如何在angularjs中從表單中查找名字和姓氏?
<body ng-app="app">
<div ng-controller="first">
<form name="myform" novalidate>
<div>
<input type="text" placeholder="FirstName lastname" ng-model="user.firstname" name="username" required style="width: 300px;padding: 20px">
<!--<span ng-show="myform.username.$dirty && myform.username.$error.required">Required</span>-->
</div>
<div>
<input type="email" placeholder="Email" ng-model="user.email" name="email" required style="width: 300px;padding: 20px;margin-top: 50px">
</div>
<p>{{user}}</p>
</form>
</div>
</body>
請摹Iive plunker鏈接..我在按鈕上點擊或添加手錶功能? – user944513