扫码关注官方订阅号
因为angularjs是做单页应用,那我想_blank跳出一个新页面呢?这个页面当然要将主页面的数据带过来,该怎么做呢
方法有很多种。
把数据编码为字符串拼接在url上,比如/page.html#data=woiqerunsdfkgjhsdfghdfjg,在新页面里用location.hash取出。
/page.html#data=woiqerunsdfkgjhsdfghdfjg
location.hash
如果不跨域,可以用localStorage。
localStorage
PostMessage接口。
PostMessage
可以考虑下angular的路由
通过angular路由,例如:
a(ui-sref="app.test_list({carId:carId,carType:carType})") 跳转
通过localStorage本地存储
1.路由 2.存储 3.存在rootscooe 中
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
方法有很多种。
把数据编码为字符串拼接在url上,比如
/page.html#data=woiqerunsdfkgjhsdfghdfjg,在新页面里用location.hash取出。如果不跨域,可以用
localStorage。PostMessage接口。可以考虑下angular的路由
通过angular路由,例如:
a(ui-sref="app.test_list({carId:carId,carType:carType})") 跳转
通过localStorage本地存储
1.路由 2.存储 3.存在rootscooe 中