码迷,mamicode.com
首页 > Web开发 > 详细

angular min js 118 Error ng areq http //errors angularjs

时间:2019-02-13 12:28:02      阅读:161      评论:0      收藏:0      [点我收藏+]

标签:tps   sof   efi   mil   图片   string   基础   lib   type   

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、解决办法

<!DOCTYPE html>
<html ng-app="userApp">
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js"></script>
		<script>
			var app = angular.module("userApp",[]);
			app.controller("username",function($scope){
				$scope.user = {name:"张丝丝"}
			});
		</script>
	</head>
	<body>
		<div ng-controller="username">  
            <input type="text" id="inp" ng-model="user.name">  
            <div>{{user.name}}</div>  
        </div>  
	</body>
</html>
技术图片

 

再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow

angular min js 118 Error ng areq http //errors angularjs

标签:tps   sof   efi   mil   图片   string   基础   lib   type   

原文地址:https://www.cnblogs.com/odejsjhshw/p/10368955.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!