Scroll two divs simultaneously

On example of diff2html result let sides = this.diffResult.nativeElement.querySelectorAll(’.d2h-file-side-diff’); sides.forEach((sideDiv,idx) => { sideDiv.addEventListener(’scroll’, (event) => { let scrollLeft = event.target.scrollLeft; sides[idx==0?1:0].scrollLeft = scrollLeft; }); });let sides = this.diffResult.nativeElement.querySelectorAll(‘.d2h-file-side-diff’); sides.forEach((sideDiv,idx) => { sideDiv.addEventListener(‘scroll’, (event) => { let scrollLeft = event.target.scrollLeft; sides[idx==0?1:0].scrollLeft = scrollLeft; }); });

*ngTemplateOutlet

<ng-template #toolbar> lorem ipsum… </ng-template>   <!– put my template here –> <ng-container *ngTemplateOutlet="toolbar"></ng-container>   <!– and here –> <ng-container *ngTemplateOutlet="toolbar"></ng-container>   <!– and here, too 😉 –> <ng-container *ngTemplateOutlet="toolbar"></ng-container><ng-template #toolbar> lorem ipsum… </ng-template> <!– put my template here –> <ng-container *ngTemplateOutlet="toolbar"></ng-container> <!– and here –> <ng-container *ngTemplateOutlet="toolbar"></ng-container> <!– and here, too 😉 –> <ng-container Read more about *ngTemplateOutlet[…]

AsyncPipe example

@Component({ … }) export class TestingComponent implements OnInit { units: any; constructor(private restService:RestService) { } ngOnInit() { this.units = this.restService.getUnits(); } }@Component({ … }) export class TestingComponent implements OnInit { units: any; constructor(private restService:RestService) { } ngOnInit() { this.units = this.restService.getUnits(); } } Template <ng-template #loading>Loading…</ng-template> <div *ngIf="units|async as units; else loading"> <span *ngFor="let unit Read more about AsyncPipe example[…]