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"
}
}
把以上兩個(gè)文件放到同一目錄
npm install
運(yùn)行index.html文件就可以看到效果了。
如果出現(xiàn):TypeError: Cannot set property '$render' of undefined
說明angular的版本太低,這個(gè)版本要求至少在v1.2.30以上.
github傳送門:https://github.com/raomojiuran/angular-bootstrap-datetimepicker
github:https://github.com/cynthiawupore
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
- Bootstrap時(shí)間選擇器datetimepicker和daterangepicker使用實(shí)例解析
- angularjs封裝bootstrap時(shí)間插件datetimepicker
- bootstrap datetimepicker日期插件使用方法
- bootstrap-datetimepicker實(shí)現(xiàn)只顯示到日期的方法
- Bootstrap3 datetimepicker控件使用實(shí)例
- bootstrap datetimepicker日期插件超詳細(xì)使用方法介紹
- 仿Angular Bootstrap TimePicker創(chuàng)建分鐘數(shù)-秒數(shù)的輸入控件
- 基于bootstrap-datetimepicker.js不支持IE8的快速解決方法
- bootstrap datetimepicker實(shí)現(xiàn)秒鐘選擇下拉框
- AngularJs中Bootstrap3 datetimepicker使用實(shí)例
相關(guān)文章
微信小程序適配iphoneX的實(shí)現(xiàn)方法
這篇文章主要介紹了微信小程序適配iphoneX的實(shí)現(xiàn)方法,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來(lái)看看吧2018-09-09
JavaScript利用fetch實(shí)現(xiàn)異步請(qǐng)求的方法實(shí)例
傳遞信息到服務(wù)器,從服務(wù)器獲取信息,是前端發(fā)展的重中之重,尤其是現(xiàn)在前后端分離的大前提下,前后端的數(shù)據(jù)交互是前端的必修科目了,下面這篇文章主要給大家介紹了關(guān)于JavaScript利用fetch實(shí)現(xiàn)異步請(qǐng)求的相關(guān)資料,需要的朋友可以參考借鑒。2017-07-07
微信小程序圖片上傳組件實(shí)現(xiàn)圖片拖拽排序
最近在寫小程序過程中遇到一個(gè)拖拽排序需求,上網(wǎng)一頓搜索未果,遂自行實(shí)現(xiàn),下面這篇文章主要給大家介紹了關(guān)于微信小程序圖片上傳組件實(shí)現(xiàn)圖片拖拽排序的相關(guān)資料,需要的朋友可以參考下2022-03-03
js左側(cè)多級(jí)菜單動(dòng)態(tài)的解決方案
實(shí)現(xiàn)的效果很簡(jiǎn)單,就是點(diǎn)一下顯示,再點(diǎn)一下就隱藏,只不過是多了幾級(jí)的問題。好,現(xiàn)在來(lái)說說我的設(shè)計(jì)思路,首先從第一級(jí)別開始,添加如下代碼2010-02-02
JavaScript對(duì)象拷貝與賦值操作實(shí)例分析
這篇文章主要介紹了JavaScript對(duì)象拷貝與賦值操作,結(jié)合實(shí)例形式分析了javascript對(duì)象定義、拷貝、賦值等相關(guān)操作技巧與注意事項(xiàng),需要的朋友可以參考下2018-12-12
javascript 容錯(cuò)處理代碼(屏蔽js錯(cuò)誤)
有時(shí)候大家來(lái)瀏覽網(wǎng)頁(yè)的時(shí)候發(fā)現(xiàn)IE瀏覽器左下角總有個(gè)黃色錯(cuò)誤標(biāo)志,有時(shí)候更是直接彈出錯(cuò)誤無(wú)法繼續(xù)瀏覽頁(yè)面,這樣對(duì)于網(wǎng)站的正規(guī)性與權(quán)威性發(fā)展不利。2010-04-04

