我只是在帐户创建结果成功的情况下尝试显示div。
HTML:
<div class="panel-title" data-ng-show="createNewUserSuccess">User Account Successful</div>
控制器js:
$scope.createNewUser = function(isValid) {
// initialization
$scope.createNewUserSuccess = false;
// check to make sure the form is completely valid
if (isValid) {
console.log("Creating New User ..");
UserPost.save( ... , function(data) {
if(data.status === 'OK'){
$scope.createNewUserSuccess = true;
console.log('User successfully created.');
} else if(data.status === 'NOT OK'){
...
}
});
}
};
});
但是它没有按预期工作,并且我可以使用错误消息进行调试。