angular报错:angular.min.js:118Error: [ng:areq] http://errors.angularjs.org/1.5.8/ng/areq
报错代码如下:
<div ng-controller="HelloAngular">
<p>{{greeting.text}},angular</p>
</div> function HelloAngular($scope){
$scope.greeting = {
text:'hello'
}
}
在用angular1.3版本以前的时候,上面的代码运行是没有问题的。但是我更新版本后报错
Error: [ng:areq] http://errors.angularjs.org/1.5.8/ng/areq?p0=*&p1=not%20a%20function%2C%20got%20undefined
at Error (native)
at http://localhost:63342/untitled1/public/javascripts/lib/angular.min.js:6:412
at sb (http://localhost:63342/untitled1/public/javascripts/lib/angular.min.js:23:18)
at Pa (http://localhost:63342/untitled1/public/javascripts/lib/angular.min.js:23:105)
at http://localhost:63342/untitled1/public/javascripts/lib/angular.min.js:89:310
at ag (http://localhost:63342/untitled1/public/javascripts/lib/angular.min.js:72:419)
at p (http://localhost:63342/untitled1/public/javascripts/lib/angular.min.js:64:262)
at g (http://localhost:63342/untitled1/public/javascripts/lib/angular.min.js:58:481)
at g (http://localhost:63342/untitled1/public/javascripts/lib/angular.min.js:58:498)
at g (http://localhost:63342/untitled1/public/javascripts/lib/angular.min.js:58:498)
因为不允许定义全局函数来污染全局对象,做好放在module.controller()这样一个函数中来操作model数据
修改后的代码
mvc.js
var app = angular.module('userApp',[]);
app.controller('HelloAngular',function($scope){
$scope.greeting = {
text:'hello'
}
}) <!doctype html>
<html ng-app="userApp">
<head>
<meta charset="utf-8">
</head> <body>
<div>
<div ng-controller="HelloAngular">
<p>{{greeting.text}},angular</p>
</div>
</div>
</body>
<script src="../public/javascripts/lib/angular.min.js"></script>
<script src="../public/javascripts/test/mvc.js"></script>
</html>
angular报错:angular.min.js:118Error: [ng:areq] http://errors.angularjs.org/1.5.8/ng/areq的更多相关文章
- angular.min.js:118 Error: [ng:areq] http://errors.angularjs.org/1.5.8/ng/areq?
1,错误如图所示 简单说下错误原因是:没有js没有注册进去. 解决方法: 1.看下index.html有没有引入你的js文件. 2.看下app.js有没有注册js,比如我这次就是这步没做好,合并代码时 ...
- AngularJS中angular.min.js:80 Error: [ng:areq] http://errors.angularjs.org/1.2.9/ng/areq
报出来的时候,出现这种错误,是因为在引入控制器的时候没有引入成功,我遇到这个错误是在因为没有将父控制器引入到子控制器中.
- vue解决启动报错cjs loader.js Error: Cannot find module '../config'问题
vue解决启动报错cjs loader.js Error: Cannot find module '../config'问题 今天下载了一个开源项目一直运行不了,折腾了半天才找到问题所在,config ...
- 【angularjs基础】ng-repeat嵌套循环报错angular.min.js:89 Error: [ngRepeat:dupes]
再写嵌套循环的时候,提示一个错误 angular.min.js: Error: [ngRepeat:dupes] 代码如下 <table class="GridViewTable mt ...
- angular 报错笔记
1.错误信息: Failed to instantiate module app due to: Error: [$injector:unpr] http://errors.angularjs.org ...
- Angular报错
报错: Module 'App' is not available! You either misspelled the module name or forgot to load it. If re ...
- (前端)angular报错日常以及记录日常
目录1 json的key...value问题 遍历json的key...value的时候报错: [tslint] for (... in ...) statements must be filtere ...
- vue npm run dev 报错 semver\semver.js:312 throw new TypeError('Invalid Version: ' + version)
npm run dev运行报错信息如下图: 原因分析: 版本问题 解决办法: 在semver.js(node_modules/semver/semver.js)里做了一些改动,代码如下: // if ...
- vue报错vue-router.esm.js?8c4f:2007 Uncaught (in promise) NavigationDuplicated {_name: "NavigationDuplicated", name: "NavigationDuplicated"}
今天在写vue项目配置好路由点击菜单时,突然在控制台报错. 错误信息如下: Uncaught (in promise) NavigationDuplicated {_name: "Navig ...
随机推荐
- PAT甲级——A1118 Birds in Forest【25】
Some scientists took pictures of thousands of birds in a forest. Assume that all the birds appear in ...
- 分享一份Java架构师学习资料,2019年最新整理!
分享一套不错的架构师学习参考资料,免费领取的,无任何套路! 关注Java大后端公众号,在后台回复关键字:大大,即可免费领取,觉得资料不错,转发给其他朋友呗- 长按关注Java大后端公众号领取.
- 04_Mybatis输入\出映射
1. 输入映射 通过paramterType指定输入参数的类型,类型可以是简单类型.hashmap.pojo的包装类. 1.1 传递pojo的包装对象 1.需求 完成用户信息的综合查询,需要传 ...
- <Python基础>装饰器的基本原理
1.装饰器 所谓装饰器一般是对已经使用(上线)的函数增加功能. 但是因为一般的大公司的严格按照开放封闭原则(对扩展是开放的,对修改是封闭的),不会让你修改原本的函数. 装饰器就是在不改变原本的函数且不 ...
- Hibernate的多对多映射
一.创建Java工程,新建Lib文件夹,加入Hibernate和数据库(如MySql.Oracle.SqlServer等)的Jar包,创建 hibernate.cfg.xml 文件,并配置,配置项如下 ...
- spring-data-JPA repository自定义方法规则
一.自定义方法的规则 Spring Data JPA框架在进行方法名解析时,会先把方法名多余的前缀截取掉,比如find,findBy,read,readBy,get,getBy,然后对剩下的部分进行解 ...
- mount: you must specify the filesystem type
最近工作中遇到一个问题,在linux mount /dev/vdb 到 /home 分区时报错: 1 2 # mount /dev/vdb /home mount: you must specif ...
- 1、docker centos 安装
Docker for CentOS: 第一步:使用官方yum仓库 [root@linux-node1 ~]# yum install -y yum-utils [root@linux-node1 ~] ...
- [转]关于 MVVMLight 设计模式系列
关于 MVVMLight 设计模式系列 http://www.wxzzz.com/958.html MvvmLight框架使用入门 http://www.cnblogs.com/manupstairs ...
- 基础回顾: 关于Session的一些细节
1 session是服务端技术, cookie是客户端技术 2 默认情况下, 一个浏览器独占一个session对象, 也就是说, 开启两个浏览器进程, 它们之间使用的session不是同一个sessi ...