从图像画廊到 GraphQL ToDo 应用的开发之旅
图像画廊应用开发
页面主体组件初始化
在编写好 LoadImageService 、 AddImageService 和 TransferDataService 后,我们可以在 PageBodyComponent 的 ngOnInit 方法中使用它们。 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;
}
超级会员免费看
订阅专栏 解锁全文

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



