angular bootstrap timepicker TypeError提示怎么辦
angular bootstrap timepicker TypeError: Cannot set property '$render' of undefined,如何解決?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.css" rel="external nofollow" >
<link rel="stylesheet" href="node_modules/angular-bootstrap-datetimepicker/src/css/datetimepicker.css" rel="external nofollow" />
</head>
<body ng-app="MyApp">
<p>{{mode}}</p>
<datetimepicker data-ng-model="mode"></datetimepicker>
</body>
<script type="text/javascript" src="node_modules/moment/moment.js"></script>
<script type="text/javascript" src="node_modules/angular/angular.js"></script>
<script type="text/javascript" src="node_modules/angular-bootstrap-datetimepicker/src/js/datetimepicker.js"></script>
<script type="text/javascript" src="node_modules/angular-bootstrap-datetimepicker/src/js/datetimepicker.templates.js"></script>
<script type="text/javascript" src="locales/bootstrap-datetimepicker.zh-CN.js"></script>
<script>
var myAppModule = angular.module('MyApp', ['ui.bootstrap.datetimepicker'])
</script>
</html>
package.json
{
"name": "cynthia",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"angular-bootstrap-datetimepicker": "^1.1.4",
"bootstrap": "^3.3.7"
}
}
把以上兩個文件放到同一目錄
npm install
運行index.html文件就可以看到效果了。
如果出現(xiàn):TypeError: Cannot set property '$render' of undefined
說明angular的版本太低,這個版本要求至少在v1.2.30以上.
github傳送門:https://github.com/raomojiuran/angular-bootstrap-datetimepicker
github:https://github.com/cynthiawupore
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
- Bootstrap時間選擇器datetimepicker和daterangepicker使用實例解析
- angularjs封裝bootstrap時間插件datetimepicker
- bootstrap datetimepicker日期插件使用方法
- bootstrap-datetimepicker實現(xiàn)只顯示到日期的方法
- Bootstrap3 datetimepicker控件使用實例
- bootstrap datetimepicker日期插件超詳細使用方法介紹
- 仿Angular Bootstrap TimePicker創(chuàng)建分鐘數(shù)-秒數(shù)的輸入控件
- 基于bootstrap-datetimepicker.js不支持IE8的快速解決方法
- bootstrap datetimepicker實現(xiàn)秒鐘選擇下拉框
- AngularJs中Bootstrap3 datetimepicker使用實例
相關(guān)文章
javascript實現(xiàn)的動態(tài)文字變換
javascript實現(xiàn)的動態(tài)文字變換...2007-07-07
基于Leaflet的Webgis經(jīng)緯網(wǎng)格功能實現(xiàn)
本文將介紹一款Leaflet的經(jīng)緯網(wǎng)插件,基于這款經(jīng)緯網(wǎng)插件,詳細介紹如何實現(xiàn)經(jīng)緯網(wǎng)功能,本文通過實例代碼給大家介紹的非常詳細,感興趣的朋友跟隨小編一起看看吧2023-12-12

