我正在制作一个基本的痕迹痕迹(使用引导程序),这将帮助用户导航出网站。使用AngularJS,我创建了一个地图模态,根据他们当前正在查看的数据提供了他们可以去哪里的选项。
为了帮助我们的用户记住他们到达那里(以及如何回来),每次钻取数据时都会附加痕迹。
我有以下代码段:
<ol class="breadcrumb">
<li ng-repeat="item in items" ng-switch on="$last">
<div ng-switch-when="false">
<a href="#">{{item}}</a> <span class="divider"> > </span>
</div>
<div ng-swtich-when="true">
{{item}}
</div>
</li>
</ol>
但它会产生一些时髦的输出。我得到以下输出:
<ol class="breadcrumb">
<li class="ng-scope" on="$last" ng-switch="" ng-repeat="item in items">
<div class="ng-binding" ng-swtich-when="true"> University </div>
<div class="ng-scope" ng-switch-when="false">
<a class="ng-binding" href="#">University</a>
<span class="divider"> > </span>
</div>
</li>
<li class="ng-scope" on="$last" ng-switch="" ng-repeat="item in items">
<div class="ng-binding" ng-swtich-when="true"> College of Engineering </div>
<div class="ng-scope" ng-switch-when="false">
<a class="ng-binding" href="#">College of Engineering</a>
<span class="divider"> > </span>
</div>
</li>
<li class="ng-scope" on="$last" ng-switch="" ng-repeat="item in items">
<div class="ng-binding" ng-swtich-when="true"> Environmental Engineering </div>
</li>
</ol>
看起来像:
以前的内容是否在重绘时没有删除?或者我需要一种比交换机更好的方法吗?
答案 0 :(得分:1)
错字..你想要ng-switch-when
代替ng-swtich-when
<div ng-swtich-when="true">