Home >Web Front-end >JS Tutorial >How to solve the angular bootstrap timepicker TypeError prompt
This article mainly introduces the solution to the angular bootstrap timepicker TypeError prompt, which has certain reference value. Interested friends can refer to it
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 into the same directory
npm install
You can see the effect by running the index.html file.
If: TypeError: Cannot set property '$render' of undefined
It means that the version of angular is too low. This version requires at least v1.2.30 or above.
The above is the detailed content of How to solve the angular bootstrap timepicker TypeError prompt. For more information, please follow other related articles on the PHP Chinese website!