我正在研究由angularJS组成的cordova应用程序。我有一个代码片段如下:
<label class="item item-input item-select">
<div class="input-label">
Select Team
</div>
<select>
<option ng-repeat="deviceEach in devices" id="{{deviceEach.id}}">{{deviceEach.name}}</option>
</select>
</label>
<label class="item item-input">
<input type="text" placeholder="Enter user Email" ng-model="newuser.username">
</label>
<br>
<button ng-click="userSubmit(newuser)" class="button button-calm">
Add User
</button>
当用户点击添加用户按钮时,它应该捕获所选选项ID和输入的用户名的值。我可以捕获输入标签的值但是如何捕获select tag选择选项的值?
答案 0 :(得分:0)
使用ng-model
Parse.Cloud.afterSave("YourObject", function(request) {
var user = Parse.User.current();
// check if the object was just created
if(request.object.existed() == false){
var newACL = new Parse.ACL();
newACL.setPublicReadAccess(false);
newACL.setPublicWriteAccess(false);
newACL.setReadAccess(user.id,true);
newACL.setWriteAccess(user.id,true);
request.object.setACL(newACL);
request.object.save();
}
});