AngularJs实现面包屑导航

1.页面样式

AngularJs实现面包屑导航_第1张图片

2.html

AngularJs实现面包屑导航_第2张图片

AngularJs实现面包屑导航_第3张图片

   
   
	  
	      			                              
	      {{entity.id}}
	      {{entity.name}}									    
	      
	      	{{entity.typeId}}  
	      									      
	      		      
	                                    
	               		                                     
	               
	     	                                             
	      
	  
   


3.js

AngularJs实现面包屑导航_第4张图片

	// 定义一个变量记录当前是第几级分类
	$scope.grade = 1;
	
	$scope.setGrade = function(value){
		$scope.grade = value;
	}
	
	$scope.selectList = function(p_entity){
		
		if($scope.grade == 1){
			$scope.entity_1 = null;
			$scope.entity_2 = null;
		}
		if($scope.grade == 2){
			$scope.entity_1 = p_entity;
			$scope.entity_2 = null;
		}
		if($scope.grade == 3){
			$scope.entity_2 = p_entity;
		}
		
		$scope.findByParentId(p_entity.id);
	}
	

 

你可能感兴趣的:(AngularJs)