使用Flex布局和组件通信构建Angular应用
1. 创建产品服务
在渲染 ngAuction 应用的工具栏后,接下来需要在工具栏下方展示产品。首先要创建 ProductService 来提供产品数据。
- 数据来源 :在实际应用中,数据通常由服务器提供,但目前使用包含产品信息的JSON文件 src/data/products.json 。以下是该文件的部分内容:
[
{
"id": 1,
"description": "Isn’t it cool when things look old, but they're not...",
"imageUrl": "data/img/radio.png",
"price": 300,
"title": "Vintage Bluetooth Radio"
},
{
"id": 2,
"description": "Be an optimist. Carry Sunglasses with you at all times...",
"featured": true,
"imageUrl": "data/img/sunnies.png",
"price": 70,
"title": "Sunglasses"
}
// ...
]
如果要自己构建 ngAuction ,需将 src
超级会员免费看
订阅专栏 解锁全文
13

被折叠的 条评论
为什么被折叠?



