我尝试按以下方式插入gridster-item属性:
<div class="myTile" gridster-item= "tile" row="0" col="0" ng-repeat="tile in selectedTiles" >
<ul class="dropdown-menu">
<li><a href="#"
id="gridster-form"
role="button"
aria-labeledby="Gridster Layout Form">
<span class="dropdown-text">
Col <input type="text" value="tile.col" integer ng-model="tile.col" size="1" class="ng-scope ng-pristine ng-untouched ng-valid">
Row <input type="text" value="tile.row" integer ng-model="tile.row" size="1" class="ng-pristine ng-untouched ng-valid">
</span>
<i class= "fa fa-arrows"></i>
</a></li>
</ul>
</div>
基本上当我放入gridster-item时,输入字段被tile.col和tile.row属性正确占用(没有它们就不显示)。
问题当我插入gridster-item属性时,它会将我的磁贴抛出到dom上的随机位置。这告诉我我没有正确使用它。有什么建议吗?
答案 0 :(得分:0)
尝试使用外部div并对其进行ng-repeat:
<div ng-repeat="tile in selectedTiles">
<div class="myTile" gridster-item= "tile" row="0" col="0" >
<ul class="dropdown-menu">
<li><a href="#"
id="gridster-form"
role="button"
aria-labeledby="Gridster Layout Form">
<span class="dropdown-text">
Col <input type="text" value="tile.col" integer ng-model="tile.col" size="1" class="ng-scope ng-pristine ng-untouched ng-valid">
Row <input type="text" value="tile.row" integer ng-model="tile.row" size="1" class="ng-pristine ng-untouched ng-valid">
</span>
<i class= "fa fa-arrows"></i>
</a></li>
</ul>
</div>
</div>