douqinlu4217 2016-07-05 23:27
浏览 163

Href在Javascript函数中不起作用

I have got this code below and I want to know how I can add a clickable link to the boxes under each title.

I want this <a href=" . '"callto://+' . $getTelephone . '"' . ">Call on Skype</a> to appear in the first box. But I cannot get it to work as the whole function just stops working when I add it.

function MyCtrl($scope) {
  $scope.environment_service_packages = 
    [
      {name: 'obj1', info: {text: '<?php echo "A html link below \
\
 Call on Skype"; ?>', show: true}},
      {name: 'obj2', info: {text: 'some extra info for obj2', show: true}},
      {name: 'obj3', info: {text: 'some extra info for obj3', show: true}},
      {name: 'obj4', info: {text: 'some extra info for obj4', show: false}},
    ];
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>

<body ng-app>
  <table ng-controller="MyCtrl" class="table table-hover table-striped">
    <tr class="info">
      <td>...</td>
    </tr>
    <tbody ng-repeat="x in environment_service_packages">
      <tr ng-click="x.info.show = !x.info.show">
        <td> {{ x.name }}
      </tr>
      <tr ng-show="x.info.show">
        <td>
          <pre>{{ x.info.text }}</pre>
        </td>
      </tr>
    </tbody>
  </table>
</body>

</div>
  • 写回答

2条回答 默认 最新

  • dongteng2534 2016-07-05 23:37
    关注

    Putting ng-repeat on the tbody will create a body for every member in the array.

    Try putting ng-repeat-start on the first row and ng-repeat-end on the second row.

    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题