angular - 以离子角度获取存储项目
问题描述
我想知道如何通过 angular 从 ionic 中的存储中获取特定项目。
逻辑
这就是我在本地存储中的内容
item {
{id: 1, title: xxxx, url: xxxx},
{id: 2, title: xxxx, url: xxxx},
{id: 3, title: xxxx, url: xxxx},
};
我需要获得特定的项目,例如:
data {
id: 1, title: xxxx, url: xxxx
}
代码
module
getDetails(url) {
return this.storage.getItem('item').then((data: any) => {
this.post.push(data);
});
}
view
[routerLink]="['/', 'posts', post.url]"
更新
我在控制台中的数据如下:
解决方案
推荐阅读
- node.js - Powershell 操作系统架构 vs NodeJs process.arch
- c++ - 从有损时间戳构建时间线
- amazon-web-services - 无法将 Aurora 数据源添加到 Amplify 应用程序
- google-analytics - 我正在使用此链接在我的仪表板中显示谷歌分析,但没有显示一些错误
- android - 如何在 JetpackCompose 上更改文本的 contentDescription
- tmux - 在 tmux 中添加键绑定以进入 vi 复制模式
- angular - 在渲染时触发 onClick 在 Angular 组件中动态创建网格问题
- python - 将 pandas Excel Dataframe 复制到没有索引标题的剪贴板
- python - 在 pandas 版本 > 1.1.5 的现有 Excel 工作表中写入特定单元格中的值
- python - pysftp 读取 csv 文件有一个 etra 引用