电商四十六、新增模板

①用angularjs的ng-model指令绑定变量。

通过前面的内容知道,angularjs的全局变量entity,即$scope.entity是对应java类TbTypeTemplate.java对象

返回TbTypeTemplate类型的对象,则response的值为返回的TbTypeTemplate类型的对象的值。

$scope.findOne = function($event){
                $scope.entity03= {id: $event.target.parentNode.parentNode.children[1].innerText};
                typeTemplateService.findOne($scope.entity03).success(
                        function(response){
                            $scope.entity = response;
                        }
                    );
            }

TbTypeTemplate类型的对象的值的属性有:

         

所以$scope.entity的包含的属性值有:

$scope.entity.id、$scope.entity.name、$scope.entity.specIds、$scope.entity.brandIds、$scope.entity.customAttributeItems。

其中$scope.entity.id不用绑定,因为是自增长类型:

$scope.entity.specIds、$scope.entity.brandIds、$scope.entity.customAttributeItems。分别都已经绑定了。

就差$scope.entity.name没有绑定。

②点击按钮,写执行方法。

 

测试:http://localhost:9101/admin/type_template.html

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值