无法运行角度JS code。与温泉科尔多瓦 [英] Unable to run angular js code with onsen cordova

查看:123
本文介绍了无法运行角度JS code。与温泉科尔多瓦的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想运行一个简单的角度JS code,但我不能做到这一点
科尔多瓦与温泉UI

I want to run a simple Angular js code but I am not able to do it in Cordova with Onsen ui

我在下面得到一个错误的链接:

I am getting an error link below :

<一个href=\"https://docs.angularjs.org/error/ng/areq?p0=HelloCtrl&p1=not%20a%20function,%20got%20undefined\" rel=\"nofollow\">https://docs.angularjs.org/error/ng/areq?p0=HelloCtrl&p1=not%20a%20function,%20got%20undefined

我指的这个页面:

https://onsen.io/blog/onsen-ui-tutorial-angularjs-essentials-for-using-onsen-ui-part-1/

使用温泉1

p1.html:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
<meta http-equiv="Content-Security-Policy"/>
<link href="css/bootstrap.min.css" rel="stylesheet"> 
<link rel="stylesheet" href="css/onsenui.css">
<link rel="stylesheet" href="css/onsen-css-components.css">
<link rel="stylesheet" href="css/sliding_menu.css">
<link rel="stylesheet" type="text/css" href="css/index.css">
<script src="js/jquery.js"></script> 
<script src="js/bootstrap.min.js"></script>
<script src="js/angular/angular.min.js"></script>
<script type="text/javascript" src="cordova.js"></script>

 <script>

 ons.bootstrap();

 var myApp = angular.module('myApp',[]);

 myApp.controller('HelloCtrl', function($scope){
     $scope.name = "Onsen UI!";
 });

</script>
</head>
<body ng-app="myApp">
<div ng-controller="HelloCtrl">
<input type="text" ng-model="name">
<p>Hello {{name}}</p>
</div> 
</body>
</html>

输出:

在这里输入的形象描述

错误:

在这里输入的形象描述

下面是我的目录结构:

在这里输入的形象描述

推荐答案

解决它......

其实当我安装我的jQuery只复制在的jquery.js 从jQuery文件夹到我的js文件夹中,但现在我复制在整个jQuery的文件夹到JS文件夹并成功执行...

Actually when I installed jquery I copied only the jquery.js file from the jquery folder into my js folder but now I copied the whole jquery folder into the js folder and It executed successfully...

感谢您的支持家伙。

这篇关于无法运行角度JS code。与温泉科尔多瓦的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆