您好,登錄后才能下訂單哦!
小編給大家分享一下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文件就可以看到效果了。
如果出現:TypeError: Cannot set property '$render' of undefined
說明angular的版本太低,這個版本要求至少在v1.2.30以上.
github傳送門:https://github.com/raomojiuran/angular-bootstrap-datetimepicker
github:https://github.com/cynthiawupore
看完了這篇文章,相信你對“angular bootstrap timepicker TypeError提示的解決方法”有了一定的了解,如果想了解更多相關知識,歡迎關注億速云行業資訊頻道,感謝各位的閱讀!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。