没有合适的资源?快使用搜索试试~ 我知道了~
Angular in Action(pdf英文原版-2018出版)
5星 · 超过95%的资源 需积分: 10 31 下载量 27 浏览量
2018-09-13
08:52:03
上传
评论 1
收藏 6.49MB PDF 举报
温馨提示
Angular in Action teaches you everything you need to build production-ready Angular applications.Thoroughly practical and packed with tricks and tips, this hands-on tutorial is perfect for web devs ready to build web applications that can handle whatever you throw at them.
资源推荐
资源详情
资源评论
Communicating between Angular components
Angular applications are based around components that communicate with one
another. You pass data into a child component using inputs and can emit events up
to a parent component that shares data. This is essentially the way that normal HTML
elements behave, which makes Angular easy to understand and learn.
The gure below shows the structure of an example application used in chapter 5: It’s
composed of a tree of components, much like what you see when creating HTML docu-
ments. The Dashboard component has four child components: two instances of the Metric
component and two of the Nodes component. The Dashboard component contains data,
which it passes to each of its children using an input binding, which is how Angular shares
data from a parent to a child component. In addition to sharing this data, Angular also
keeps track of data changes and understands when to redraw the screen.
App
component
#dashboard
[cpu]
(onRefresh)
Navbar
component
Dashboard
component
Nodes Row
component
Nodes Row
component
Nodes Row
component
Nodes Row
component
Nodes Row
component
Nodes Row
component
[mem] [cluster1]
[cluster2]
Metric
component
Nodes
component
Nodes
component
Metric
component
Key:
[Input bindings]
(Emit output events)
#Local template variable
[node] [node] [node] [node] [node] [node]
Inputs let us send data from a parent to a child, but outputs allow data to ow in the
other direction. Similar to how events bubble up to their parent, outputs are Angular’s
syntax for allowing a child to pass data or events back to its parent. In the gure, the
Navbar component sends an output event to the App component. The App compo-
nent waits until an output event is red and then reacts accordingly. In this example,
the App component refreshes the data on the page, but you can trigger any type of
logic to execute. Angular provides other ways to communicate, such as using services
or local template variables, which are covered in detail in this book.
www.allitebooks.com
For online information and ordering of this and other Manning books, please visit www.manning.com.
The publisher offers discounts on this book when ordered in quantity. For more information, please
contact
Special Sales Department
Manning Publications Co.
20 Baldwin Road
PO Box 761
Shelter Island, NY 11964
Email: orders@manning.com
©2018 by Manning Publications Co. All rights reserved.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form
or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the
publisher.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed
as trademarks. Where those designations appear in the book, and Manning Publications was aware of a
trademark claim, the designations have been printed in initial caps or all caps.
Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books
we publish printed on acid- free paper, and we exert our best efforts to that end. Recognizing also our
responsibility to conserve the resources of our planet, Manning books are printed on paper that is at
least 15 percent recycled and processed without the use of elemental chlorine.
∞
Manning Publications Co.
20 Baldwin Road
PO Box 761
Shelter Island, NY 11964
Development editors: Cynthia Kane, Helen Stergius
Review editor: Ivan Martinovic´
Technical development editor: Alain Couniot
Project editor: Kevin Sullivan
Copyeditor: Corbin Collins
Proofreader: Alyson Brener
Technical proofreader: Tanya Wilke
Typesetter: Happenstance Type- O-Rama
Cover designer: Marija Tudor
ISBN 9781617293313
Printed in the United States
1 2 3 4 5 6 7 8 9 10 - EBM - 23 22 21 20 19 18
www.allitebooks.com
剩余320页未读,继续阅读
资源评论
- mirror_mask2019-01-14很不错,最需要的就是这个英文版本。
mingscsdn
- 粉丝: 2
- 资源: 21
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功