没有合适的资源?快使用搜索试试~ 我知道了~
首页Angular in Action
Angular in Action
需积分: 9 33 浏览量
更新于2023-05-28
评论
收藏 6.64MB PDF 举报
manning Angular in Action 已针对Angular 2+ 进行全新升级!!!
资源详情
资源评论
资源推荐

MANNING
Jeremy Wilken

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.

Angular in Action
JEREMY WILKEN
MANNING
Shelter ISland

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

To my parents, who gave me great encouragement, support, and latitude to become
what I am today.
剩余320页未读,继续阅读















「已注销」
- 粉丝: 1
- 资源: 7
上传资源 快速赚钱
我的内容管理 收起
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助

会员权益专享
最新资源
- Xilinx SRIO详解.pptx
- Informatica PowerCenter 10.2 for Centos7.6安装配置说明.pdf
- 现代无线系统射频电路实用设计卷II 英文版.pdf
- 电子产品可靠性设计 自己讲课用的PPT,包括设计方案的可靠性选择,元器件的选择与使用,降额设计,热设计,余度设计,参数优化设计 和 失效分析等
- MPC5744P-DEV-KIT-REVE-QSG.pdf
- 通信原理课程设计报告(ASK FSK PSK Matlab仿真--数字调制技术的仿真实现及性能研究)
- ORIGIN7.0使用说明
- 在VMware Player 3.1.3下安装Redhat Linux详尽步骤
- python学生信息管理系统实现代码
- 西门子MES手册 13 OpcenterEXCR_PortalStudio1_81RB1.pdf
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制

评论0