如何在angularJS中将数据从一个html页面传递到另一页面? [英] How to pass data from one html page to another in angularJS?

查看:50
本文介绍了如何在angularJS中将数据从一个html页面传递到另一页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个html页面.第一页是患者列表,每个患者列表都是超链接.预期的行为是,在单击超链接(对应于患者)后,应将用户重定向到另一个具有相应患者详细信息的html页面.重定向正在发生.但是,我无法将数据从第一个html页传递到第二个html页.

I have two html pages. First page being a list of patients each being a hyperlink. The expected behavior is that, on click of a hyperlink ( corresponding to a patient), the user should be redirected to another html page which has the details of the corresponding patient. The redirection is happening. But, I am not able to pass the data from the first html page to the second one.

推荐答案

有很多方法可以做到这一点:

There are plenty of way to do that:

  1. 浏览器的本地存储(角度插件)
  2. URL参数(角度$ location )
  3. 服务器端会话
  4. 如今已经过时且效率低下的Cookie,最好选择#1(使用带角度的cookie)

最合适的实现方式取决于您正面/背面的体系结构

Best applicable implementation depends on your architecture on front/back

这篇关于如何在angularJS中将数据从一个html页面传递到另一页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆