angular.js1项目使用记录


后端返回字符串,定义对象.属性接收,
$scope.image_entity.url=response.message;//设置文件地址

后端返回对象,response==即是后台对象
$scope.typeTemplate=response;//获取类型模板

后端返回集合
$scope.specList=response;

普通div标签或列表获取后端值
{{entity.goods.typeTemplateId}}

输入框获取后端返回值
<input ng-model="entity.goods.typeTemplateId">

service.js请求后台只能是本项目Controller.java,
Controller.js有注释js功能


// 定义模块:
var app = angular.module("pinyougou",[]);


// 定义过滤器
app.filter('trustHtml',['$sce',function($sce){
return function(data){//传入参数时被过滤的内容
return $sce.trustAsHtml(data);//返回的是过滤后的内容(信任html的转换)
}
} ]);

//$location用法
传: seckill-index.html: <a class='sui-btn btn-block btn-buy' href='seckill-item.html#?id={{pojo.id}}' >立即抢购</a>
接收 seckillGoodsController.js: var id= $location.search()['id'];

ng-options   获取后端返回给前端值,下拉遍历使用


//页面显示权限控制,search.html

原文地址:https://www.cnblogs.com/binghuaZhang/p/14343216.html