angular2怎么使用第三方的库
2个回答
展开全部
解决流程
1:配置package.json添加新依赖进行update,载新库
"jquery":"*", "tether":"*", "bootstrap":"*", "moment":"*", "eonasdan-bootstrap-datetimepicker":"*"
2: 配置angular-cli.json
"styles": [ "../node_modules/bootstrap/dist/css/bootstrap.min.css", "../node_modules/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css", "styles.css" ], "scripts": [ "../node_modules/jquery/dist/jquery.min.js", "../node_modules/tether/dist/js/tether.min.js", "../node_modules/bootstrap/dist/js/bootstrap.min.js", "../node_modules/moment/min/moment.min.js", "../node_modules/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js" ],
3: 模版使用datatimepicker插件
<div class="container"> <div class="row"> <div class='col-sm-6'> <div class="form-group"> <div class='input-group date' id='datetimepicker1'> <input type='text' class="form-control" /> <span class="input-group-addon"> <span class="glyphicon glyphicon-calendar"></span> </span> </div> </div> </div> </div></div>
1:配置package.json添加新依赖进行update,载新库
"jquery":"*", "tether":"*", "bootstrap":"*", "moment":"*", "eonasdan-bootstrap-datetimepicker":"*"
2: 配置angular-cli.json
"styles": [ "../node_modules/bootstrap/dist/css/bootstrap.min.css", "../node_modules/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css", "styles.css" ], "scripts": [ "../node_modules/jquery/dist/jquery.min.js", "../node_modules/tether/dist/js/tether.min.js", "../node_modules/bootstrap/dist/js/bootstrap.min.js", "../node_modules/moment/min/moment.min.js", "../node_modules/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js" ],
3: 模版使用datatimepicker插件
<div class="container"> <div class="row"> <div class='col-sm-6'> <div class="form-group"> <div class='input-group date' id='datetimepicker1'> <input type='text' class="form-control" /> <span class="input-group-addon"> <span class="glyphicon glyphicon-calendar"></span> </span> </div> </div> </div> </div></div>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询