首页 > 其他 > 详细

ngRx 官方示例分析 - 1. 介绍

时间:2017-03-13 14:47:35      阅读:155      评论:0      收藏:0      [点我收藏+]

ngRx 的官方示例演示了在具体的场景中,如何使用 ngRx 管理应用的状态。

示例介绍

示例允许用户通过查询 google 的 book  API  来查询图书,并保存自己的精选书籍列表。

技术分享

菜单有两个菜单项,分别是我的精选和图书浏览。

技术分享

进入图书浏览页面后,可以输入搜索的书名。应用将在线搜索匹配的图书。

技术分享

点击图书之后,可以得到图书的详细信息。如果图书还没有被收藏,则提示添加到收藏中。

技术分享

如果已经添加到收藏中,则变成从收藏中移除。

技术分享

在我的收藏中,可以看到当前收藏的图书列表。

技术分享

示例快速上手

# clone the repo
git clone https://github.com/ngrx/example-app.git

# change directory to repo
cd example-app

# Use npm or yarn to install the dependencies:
npm install

# OR
yarn

# start the server
ng serve

Navigate to http://localhost:4200/ in your browser

参考资源:

ngrx/store in GitHub

ngrx/example-app in GitHub

 

ngRx 官方示例分析 - 1. 介绍

原文:http://www.cnblogs.com/haogj/p/6542237.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!