Seeking a way to incorporate the google diff/match/patch lib
into an Angular application for displaying the variance between two texts.
Here's how I plan on using it:
public ContentHtml: SafeHtml;
compare(text1: string, text2: string):void {
var dmp = new diff_match_patch();
dmp.Diff_Timeout = 1;
dmp.Diff_EditCost = 4;
var d = dmp.diff_main(text1, text2);
dmp.diff_cleanupSemantic(d);
var ds = dmp.diff_prettyHtml(d);
this.ContentHtml = this._sanitizer.bypassSecurityTrustHtml(ds);
}
The issue lies in importing diff_match_patch
for this particular line:
var dmp = new diff_match_patch();