ABenassi87 / ngx-text-diff

A Text Diff component for Angular
https://ngx-text-diff.herokuapp.com/home
50 stars 44 forks source link

`hideMatchingLines` attribute doesn't work #28

Open djorg83 opened 4 years ago

djorg83 commented 4 years ago

When passing hideMatchingLines=true, the unmatched lines still show.

Example

<td-ngx-text-diff [left]="leftText" [right]="rightText" [hideMatchingLines]="true"></td-ngx-text-diff>

Cause

The @Input() should be on the setter, not the getter.

@Input()
get hideMatchingLines() {
  return this._hideMatchingLines;
}

set hideMatchingLines(hide: boolean) {
  this.hideMatchingLinesChanged(hide);
}

Solution

Move the @Input() to the setter.

get hideMatchingLines() {
  return this._hideMatchingLines;
}

@Input()
set hideMatchingLines(hide: boolean) {
  this.hideMatchingLinesChanged(hide);
}
seiwonlee commented 3 years ago

any update on this? This property doesn't seem to work still...

riccardotreagles commented 3 years ago

I'm using ng9. diff text works fine, but "loading indicator" and "hideMatchingLines" doesn't work