【发布时间】:2017-05-01 20:08:11
【问题描述】:
我正在尝试在不使用服务的情况下在 html 页面之间传递表单数据。
这是我的代码链接 --> http://plnkr.co/edit/E6LM5Oq67XRcvVuMIv9i?p=preview 下面是我的contacts.html页面。
<html>
<head>
<title>Contacts Page</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular-route.js"></script>
<script src="app.js"></script>
</head>
<body ng-app="myApp" >
<table>
<tr>
<th>User ID</th>
<th>First Name</th>
<th>Last Name</th>
<th>Phone Number</th>
</tr>
<tr ng-repeat="contact in contacts">
<td>{{contact.uid}}</td>
<td>{{contact.fname}}</td>
<td>{{contact.lname}}</td>
<td>{{contact.pphone}}</td>
</tr>
</table>
</body>
</html>
数据没有传递给contacts.html。如何做到这一点?
【问题讨论】:
-
请在您的问题中包含所有相关信息(包括代码)。看看How to Ask 和minimal reproducible example。
-
贴出代码
-
两者都是不同的 HTML 页面。你不能这样传递数据。
-
我可以在同一个 html 页面中显示数据,但还有其他方式在另一个页面中显示数据吗?
-
您可以将数据作为查询字符串参数传递到不同的页面
标签: javascript html angularjs