您当前的位置: 首页 >  分类

24分布式电商项目 - 商品分类管理(面包屑导航)

杨林伟 发布时间:2019-07-04 11:24:04 ,浏览量:3

我们需要返回上级列表,需要通过点击面包屑来实现

修改 itemCatController.js

$scope.grade=1;//默认为 1 级
//设置级别
$scope.setGrade=function(value){
	$scope.grade=value;
}
//读取列表
$scope.selectList=function(p_entity){
	if($scope.grade==1){//如果为 1 级
		$scope.entity_1=null;
		$scope.entity_2=null;
	}
	if($scope.grade==2){//如果为 2 级
		$scope.entity_1=p_entity;
		$scope.entity_2=null;
	}
	if($scope.grade==3){//如果为 3 级
		$scope.entity_2=p_entity;
	}
	$scope.findByParentId(p_entity.id); //查询此级下级列表
}

修改列表的查询下级按钮,设定级别值后显示列表

 
	查询下级  

这里我们使用了 ng-if 指令,用于条件判断,当级别不等于 3 的时候才显示“查询下级”按 钮 绑定面包屑:

  1. 顶级分类列表
  2. {{entity_1.name}}
  3. {{entity_2.name}}
关注
打赏
1688896170
查看更多评论

杨林伟

暂无认证

  • 3浏览

    0关注

    3183博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.1632s