构建照片画廊与待办事项应用:MEAN 栈与 GraphQL 实践
1. 照片画廊应用开发
1.1 页面主体组件初始化
在页面主体组件初始化时,我们可以使用已编写好的 LoadImageService 、 AddImageService 和 TransferDataService 。在 ngOnInit 方法中,首先调用 TransferDataService 的 Initialize 函数:
ngOnInit() {
this.transfer.Initialize();
}
为了填充 Pictures 数组,需要连接到两个 RxJS 服务的上下文:
this.addImage.context.subscribe(message => {
if (!message) {
return;
}
this.Pictures.push(message);
});
this.loadImage.context.subscribe(message => {
if (!message) {
return;
}
this.Pictures.push(message);
});
超级会员免费看
订阅专栏 解锁全文

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



