angular bootstrap timepicker TypeError提示怎么办

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

angular bootstrap timepicker TypeError提示怎么办

Cynthia娆墨旧染   2020-05-15 我要评论

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/bootstraphttps://img.qb5200.com/download-x/dist/css/bootstrap.css" rel="external nofollow" >
  <link rel="stylesheet" href="node_modules/angular-bootstrap-datetimepicker/src/csshttps://img.qb5200.com/download-x/datetimepicker.css" rel="external nofollow" />
</head>
<body ng-app="MyApp">
<p>{{mode}}</p>
  <datetimepicker data-ng-model="mode"><https://img.qb5200.com/download-x/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/jshttps://img.qb5200.com/download-x/datetimepicker.js"></script>
  <script type="text/javascript" src="node_modules/angular-bootstrap-datetimepicker/src/jshttps://img.qb5200.com/download-x/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文件就可以看到效果了。 

如果出现:TypeError: Cannot set property '$render' of undefined

说明angular的版本太低,这个版本要求至少在v1.2.30以上.

github传送门:https://github.com/raomojiuran/angular-bootstrap-datetimepicker

github:https://github.com/cynthiawupore

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们