Hexo


  • 首页

  • 关于

  • 标签

  • 分类

  • 归档

  • 日程表

  • 站点地图

  • 公益404

angular4主从结构子组件传递消息到父组件

发表于 2018-06-13 | 分类于 angular

父组件

引用子组件
注意采用"()"而不是"[]"
1
<app-hero-detail (params)="yourmethod($event)"></app-hero-detail>

子组件

定义接收参数

@out() params:EventEmitter<boolean> = new EventEmitt();

constructor() {
    this.params.emit(true);
 }
阅读全文 »

angular4主从结构父组件参数传递到子组件

发表于 2018-06-13 | 分类于 angular

父组件

引用子组件

1
<app-hero-detail [params]="params"></app-hero-detail>

子组件

定义接收参数

1
$ @Input() params:params

然后你就可以使用params这个参数了.

碰到的问题:
父组件第一次改变参数后子组件相应做出改变,父组件之后的参数改变,却无法再次使子组件改变,是因为什么?需要怎么修改?原理?
ps:第一次父组件改变参数为true,子组件弹出提示,第二次乃至以后却无法使子组件弹出

参考文章:

angular中文官网

初次使用hexo

发表于 2018-06-12

时间: 2018-06-12 03:31:00

参考文章:

手把手教你用Hexo+Github 搭建属于自己的博客

Hello World

发表于 2016-06-01

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment

1…45

xcxd

一小步一小步

44 日志
21 分类
21 标签
RSS
© 2019 xcxd
由 Hexo 强力驱动
|
主题 — NexT.Muse v5.1.4