Please check this comparison-mvc-final.zip. The following files have been updated:
package.json-"@groupdocs.examples.angular/comparison": "^0.8.88"app.module.tshas been updated to
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { ComparisonModule } from "@groupdocs.examples.angular/comparison";
import { CommonModule } from '@angular/common';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule,
CommonModule,
FontAwesomeModule,
ComparisonModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule {}
app.component.tshas been updated to useAfterViewInithook
...
// Use AfterViewInit lifecycle hook instead of OnInit since we have to be sure
// that the the app initialized.
ngAfterViewInit() {
const firstFile = this.selectFirstDefaultFile("test.docx", '');
const secondFile = this.selectSecondDefaultFile("test1.docx", '');
//we need it here to notfy about the local changes
//see more at https://blog.angular-university.io/angular-debugging/
this.changeDetectorRef.detectChanges();
forkJoin([firstFile, secondFile]).subscribe(() => {
this.compare();
});
}
...
app.component.lesshas been copied from comparison-app.component.lessapp.component.variables.lesshas been copied from variables.lessapp.component.htmlhas been copied from comparison-app.component.html - this file contains all the UI components and blocks so you have the full controll over them.
You can move the logic you have from ngOnViewInit to ngAfterViewInit as this function is more suitable for running the code that leads to the changes in front-end components.
Please let us know if it works as expected on your side.