加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angularjs – 角表行指令不在表内渲染

发布时间:2020-12-17 08:37:30 所属栏目:安全 来源:网络整理
导读:我试图添加一行“isrcrow”指令到表如下: table class="table" theadtr thArtist Name/th thTrack Title/th thVersion/th thTrack Duration/th thRecording Year/th th/th /tr /thead tbody isrcrow/isrcrow /tbody /table 这里是指令: (function() { var
我试图添加一行“isrcrow”指令到表如下:
<table class="table">
        <thead><tr>
                   <th>Artist Name</th>
                   <th>Track Title</th>
                   <th>Version</th>
                   <th>Track Duration</th>
                   <th>Recording Year</th>
                   <th></th>
               </tr>
        </thead>
        <tbody>
            <isrcrow></isrcrow>
        </tbody>       

    </table>

这里是指令:

(function() {
  var isrcorderapp;

  isrcorderapp = angular.module("isrcorderapp",[]);

  isrcorderapp.controller("isrcordercontroller",function($scope,$http) {
    return $scope.recordingTypes = [
      {
        type: 'Single'
      },{
        type: 'Album'
      },{
        type: 'Live'
      },{
        type: 'Concert'
      },{
        type: 'Instrumental'
      }
    ];
  });

  isrcorderapp.directive("isrcrow",function() {
    return {
      restrict: 'E',template: '<tr>
                <td><input id="artist" ng-model="name"/></td>
                <td><input id="track"/></td>
                <td><select id="isrctype" ng-model="isrctype" ng-change="setState(state)" ng-options="s.type for s in recordingTypes" class="ng-pristine ng-valid"></select></td>
                <td><input id="duration"/></td>
                <td><input id="year"/></td>
                <td><input type="button" value="Add ISRC" onclick="AddIsrc()" class="btn btn-small btn-success" />
                    <input type="button" value="Delete" onclick="RemoveIsrc()" class="btn btn-small btn-danger" />
                </td>
            </tr>',scope: {
        name: '='
      },link: function(scope,element,attr) {}
    };
  });

}).call(this);

我经历的问题是isrcrow指令不呈现在表体内。它在桌子外面和上面:

有谁知道什么可能导致这种行为?

添加我的评论的摘要作为答案,因为它似乎已经帮助OP。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读