[ 登录注册 ]

yuyan

angular.min.js:118 Error: [ng:areq] http://errors.angularjs.

2016/08/25 22:33 游海东的技术专栏 返回上一页

1、错误描述

angular.min.js:118 Error: [ng:areq] http://errors.angularjs.org/1.5.8/ng/areq?p0=username&p1=not%20a%20function%2C%20got%20undefined
    at Error (native)
    at http://127.0.0.1:8020/AngularJS/js/angular.min.js:6:412
    at sb (http://127.0.0.1:8020/AngularJS/js/angular.min.js:23:18)
    at Pa (http://127.0.0.1:8020/AngularJS/js/angular.min.js:23:105)
    at http://127.0.0.1:8020/AngularJS/js/angular.min.js:89:310
    at ag (http://127.0.0.1:8020/AngularJS/js/angular.min.js:72:419)
    at p (http://127.0.0.1:8020/AngularJS/js/angular.min.js:64:262)
    at g (http://127.0.0.1:8020/AngularJS/js/angular.min.js:58:481)
    at g (http://127.0.0.1:8020/AngularJS/js/angular.min.js:58:498)
    at g (http://127.0.0.1:8020/AngularJS/js/angular.min.js:58:498)


2、错误原因

<!DOCTYPE html>
<html ng-app>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript" src="../js/angular.min.js" ></script>
	</head>
	<body>
		<div ng-controller="username">
			<input type="text" id="inp" ng-model="user.name">
			<div>{{user.name}}</div>
		</div>
		<script>
			function username($scope)
			{
				$scope.user = {name:"张丝丝"};
			}
		</script>
	</body>
</html>


3、解决办法


文章来源:http://www.bozhiyue.com/web/yuyan/2016/0825/433309.html
评论
发表评论