Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/433.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 角度不工作,但没有错误_Javascript_Angularjs - Fatal编程技术网

Javascript 角度不工作,但没有错误

Javascript 角度不工作,但没有错误,javascript,angularjs,Javascript,Angularjs,遵循我的代码不会将{{title}}输出为“helloworld”。虽然angular不工作,但未给出错误消息 <!-- HTML --> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Angular</title> </head> <body np-app="myApp"> <div ng

遵循我的代码不会将{{title}}输出为“helloworld”。虽然angular不工作,但未给出错误消息

<!-- HTML -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Angular</title>
</head>
<body np-app="myApp">
<div ng-controller="MainController">
{{ title }}
</div>
<script src="https://code.jquery.com/jquery-2.2.4.min.js"                    integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="   crossorigin="anonymous"></script>`
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js"></script>
<script type="text/javascript" src="angular.js"></script>
</body>
</html>

您的body标签中有一个输入错误,需要更改为


希望这有帮助

哈哈哦。谢谢你,伙计!
var app = angular.module("myApp", []);
app.controller("MainController", ['$scope', function($scope){
    $scope.title = "hello world";
}]);