July 2019
Intermediate to advanced
416 pages
10h 6m
English
Now that we have LoadImageService, AddImageService, and TransferDataService written, we can use them in the PageBodyComponent initialization code in ngOnInit, which is called when the component is initializing. The first thing we need to do is affect is to call the Initialize function in TransferDataService:
ngOnInit() { this.transfer.Initialize();}
To finish off this component, and to actually populate the Pictures array, we need to hook up to the context for both of our RxJS services:
this.addImage.context.subscribe(message => { if (!message) { return; } this.Pictures.push(message);});this.loadImage.context.subscribe(message => { if (!message) { return; } this.Pictures.push(message);});
Read now
Unlock full access