AngularJs如何传递Json字符串到$scope.msg=msg.data
AngularJs how to pass Json String into $scope.msg=msg.data
public JsonResult Authe(string Email, string Password, bool ? Active) {
var x = (from n in db.Authntications where n.Email == Email && n.Password == Password select n).FirstOrDefault();
if (x != null) {
var xx = (from n in db.Authntications where n.Email == Email && n.Password == Password && n.Active == Active select n).FirstOrDefault();
if (xx == null) {
msg = "Your A/c not activated....";
}
} else
msg = "Your Account Details Not Valid please check Details You mentiond...";
return new JsonResult {
JsonRequestBehavior = JsonRequestBehavior.AllowGet
};
}
AngularJs
var ZmrSer = MyAuthneticService.Authen(Sucess);
$scope.msg = msg.data;
$('#modalSuccess').modal('show');
您应该从允许get行为的操作方法返回Json
。
return Json(msg, JsonRequestBehavior.AllowGet);
相关文章:
- AngularJS:ng之后,重复$scope值未按预期更新
- $ionicplatform内的$scope不;不起作用
- 使用$scope方法时的ControllerAs语法
- 如何将ngrepeat下的ngmodel绑定到$scope
- 另一个if(!$scope.$$phase)$scope$apply()szenario-需要帮助才能通关
- 使用AngularJS Directive WHITOUT$scope创建一个动态html元素
- $scope变量被视为字符串AngularJs
- ng在更新$scope后重复不更新信息
- 正在获取Angular以检测$scope中的更改
- 如何惯用地手动销毁scope&在AngularJS中重新创建
- Understanding Javascript scope with "var that = this&qu
- AngularJS,angular.element($0).scope()揭示了每个控制器的函数
- Ng出口无法访问父$scope
- ng选项-用vm替换$scope
- $scope变量,ng隐藏/显示
- 强制 $scope.$watch 只开火一次
- Ionic:AngularJS变量未使用$scope更新DOM
- Angular$scope在模式窗口内不起作用
- 在将绑定应用于控制器之后,是否会发出Angular$scope事件
- AngularJs如何传递Json字符串到$scope.msg=msg.data