Javascript 使用ng repeat将选定的href显示到块 {{scenario.name}
我需要在href中选择field.name以在同一页面中将相应的选定字段显示为块。但它总是重定向到#,并且没有数据显示。Javascript 使用ng repeat将选定的href显示到块 {{scenario.name},javascript,angularjs,html,Javascript,Angularjs,Html,我需要在href中选择field.name以在同一页面中将相应的选定字段显示为块。但它总是重定向到#,并且没有数据显示。 请告知是否可以在同一页中显示所选字段的值。请详细说明??您使用的是ng路由还是ui路由器??还是什么都没有?在href中给出你的页面url。它不会跳转到另一个页面,我正在使用ngRoute,但在那里我需要显示从外部href选择的块下面的数据。你能写你的js代码吗。这只是html。 <div class="col-md-4"> <ul class="
请告知是否可以在同一页中显示所选字段的值。请详细说明??您使用的是
ng路由
还是ui路由器
??还是什么都没有?在href中给出你的页面url。它不会跳转到另一个页面,我正在使用ngRoute,但在那里我需要显示从外部href选择的块下面的数据。你能写你的js代码吗。这只是html。
<div class="col-md-4">
<ul class="list-group text-left">
<a href="#" class="list-group-item" ng-click="selectedIndex = $index" ng- repeat="field in Data">
{{ field.name }}</a>
</ul>
</div>
<div class="col-md-8">
<div ng-show="selectedIndex == $index" ng-repeat="field in Data">
<div class="panel panel-primary" ng-repeat="scenario in field.scenarios track by $index">
<div class="panel-heading ">
{{ scenario.name }}
</div>
</div>
</div>