当发生以下步骤时,我的应用程序似乎破了。
<div ng-controller="class" data-ng-init="getAllUsers()">
<div class="col-md-6">
this is where all the users go
<table ng-table="zz">
<tr ng-repeat="user in $data |filter: { _class: '!' + classEdit }">
<td>
<div class="radio">
<label><input type="radio" name="userN" ng-click="userId(user._id)">{{user.firstname}} {{user.lastname}} </label>
</td>
</tr>
</table>
</div>
<div class="col-md-6">
<p>what type of account? </p>
<div class="radio">
<label><input type="radio" name="userRole" ng-model="userRole" value="teacher">Teacher</label>
</div>
<div class="radio">
<label><input type="radio" name="userRole" ng-model="userRole" value="ta">ta</label>
</div>
<div class="radio">
<label><input type="radio" name="userRole" ng-model="userRole" value="student">Student</label>
</div>
<button type="submit" ng-click="updateClass()" class="btn btn-info">Add To Class</a>
</div>
$scope.updateClass = function() {
$state.transitionTo($state.current, $stateParams, {
reload: true, inherit: true, notify: true
});
$http({
method: 'POST',
url: '/updateClass',
data: {userRole:$scope.userRole,
userId:$scope.userUpdate,
Id:$rootScope.classEdit
}
}).then(function(result) {
});
};
如果有更好的方式进行更新,我会接受建议。
答案 0 :(得分:0)
我最终弄明白了。不是一个ui的事情,发送http发布请求的角度但不是但不发回任何东西。