我在我的项目中正常使用angular的最新版本中的Mat Autocomplete并得到这种类型的错误

时间:2018-08-02 09:20:44

标签: angular angular-material material-design

<div class="well">
    <div class="draggable">CONTENT</div>
    <div class="draggable">CONTENT 2</div>
    <div class="draggable">CONTENT 3</div>
</div>
<div id="droppable1" class="well col-md-3" style="z-index:-1;"></div>
<div id="droppable2" class="well col-md-9" style="z-index:-1;"></div>

<script>
$('.draggable').draggable({
    helper: 'clone',
    revert: "invalid",  
    containment: "document"   
});


//ui.draggable is the object of dragged item
$('#droppable1, #droppable2').droppable({
    accept: '.draggable',
    drop: function (event, ui) {  
        ui.draggable.remove();
        $(this)
            .append(ui.helper.addClass('test').clone(false).css({
                position: 'relative',
                left: '0px',
                top: '0px',
                color:'red'
            })
        );  
    }
});  
</script>

enter image description here

在我使用材料设计引导程序的项目中使用它时,出现此错误。

1 个答案:

答案 0 :(得分:0)

您正在使用id,但从未在任何地方声明它。

ts:

public id = 'my-input';