ui-router角度主要详细视图

时间:2016-10-31 07:22:58

标签: javascript angularjs angular-ui-router

我正在尝试在同一页面上获取用户列表[master]和用户详细信息[详细信息]。

https://plnkr.co/edit/EKY2pztGkKXUuQIyefUY?p=preview

模块和配置。

public class Product {
private int id;
private String ProductName;
private int Quantity;

public Product(int _id, String _productname, int _quantity) {
    this.id = _id;
    this.ProductName = _productname;
    this.Quantity = _quantity;
}

public int getId() {
    return id;
}

public void setId(int id) {
    this.id = id;
}

public String getProductName() {
    return ProductName;
}

public void setProductName(String productName) {
    this.ProductName = productName;
}

public int getQuantity() {
    return Quantity;
}

public void setQuantity(int quantity) {
    this.Quantity = quantity;
}

当我点击主列表中的用户时,主列表在scree上呈现两次。

你可以告诉我哪里出错了吗

1 个答案:

答案 0 :(得分:0)

已调整并working plunker

只为孩子使用不同的模板

.state('user.details', {
      url : '/:id',
      //templateUrl:'users.html',
      templateUrl:'details.html',
      controller : 'usersControllerDetail'
});

这可能是模板

<div>

 <div ui-view>
  <h3>current state name: <var>{{$state.current.name}}</var></h3>


  <h5>params</h5>
  <pre>{{$stateParams | json}}</pre>
  <h5>state</h5>
  <pre>{{$state.current | json}}</pre>

 </div>
</div>
相关问题