Home>

angular bootstrap timepicker typeerror:cannot set property "$render" of undefined, how to solve it?

<! 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"
 }
}

Put the above two files in the same directory

npm install

Run the index.html file to see the effect.

If it appears:typeerror:cannot set property "$render" of undefined

That angular version is too low,This version requires at least v1.2.30 and above.

GitHub portal:https://github.com/raomojiuran/angular- bootstrap-datetimepicker

github:https://github.com/cynthiawupore

  • Previous The role of Android xmlns and its custom examples
  • Next C # implementation example to get the form to focus
  • Trends