请帮忙了解问题所在.我对AngularJS很新,也许我错过了一些东西.这是我简单的HTML:
<!DOCTYPE html>
<html>
<script type="text/javascript" src="angular.js"></script>
<script type="text/javascript" src="app.js"></script>
</head>
<body ng-app="myApp">
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
JS
(function(){
var app = angular.module('myApp',[]);
});
Run Code Online (Sandbox Code Playgroud)
和所有时间错误:
未捕获错误:[$ injector:modulerr]由于以下原因无法实例化myApp模块:错误:[$ injector:nomod]模块'myApp'不可用!您要么错误拼写了模块名称,要么忘记加载它.如果注册模块,请确保将依赖项指定为第二个参数.
我对 PHP 很陌生,我需要你的帮助!我需要为我的应用程序编写后端,用于接收 json post 并将数据写入 json 文件。我坚持循环遍历数组。
$postData = file_get_contents("php://input");
$request = json_decode($postData);
var_damp($request)
Run Code Online (Sandbox Code Playgroud)
显示数组:
array(2) {
[0]=>
object(stdClass)#1 (8) {
["name"]=>
string(11) "Alex Jordan"
["email"]=>
string(14) "alex@gmail.com"
["phone"]=>
int(123456789)
["street"]=>
string(12) "street, str."
["city"]=>
string(7) "Chicago"
["state"]=>
string(7) "Chicago"
["zip"]=>
string(5) "07202"
["$$hashKey"]=>
string(8) "object:3"
}
[1]=>
object(stdClass)#2 (8) {
["name"]=>
string(15) "Michael Jonhson"
["email"]=>
string(17) "michael@gmail.com"
["phone"]=>
float(11987654321)
["street"]=>
string(12) "street, str."
["city"]=>
string(11) "Los Angeles"
["state"]=>
string(10) "California"
["zip"]=>
string(5) "27222"
["$$hashKey"]=>
string(8) "object:4"
}
} …Run Code Online (Sandbox Code Playgroud)