当我尝试在TS文件中的OnInit函数中打开模式时,我得到了$(...).modal is not a function错误。
首先,我在index.html中加载了Jquery.min.js,然后加载了bootstrap.min.js
我在我的bootstrap应用程序中使用了浮动标签,它可以与jquery一起使用
$(document).ready(function(){
$('[data-toggle="floatLabel"]')
.attr('data-value', $(this).val())
.on('keyup change', function() {
$(this).attr('data-value', $(this).val());
});
$('#exampleModal').modal('show');
});发布于 2019-01-11 17:04:37
也许你错误地排序了库
您需要推送jquery库
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
在启动之前
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
https://stackoverflow.com/questions/54141545
复制相似问题