2

Does Angular 2+ (Angular 7 to be exact) have a code diff component or plugin that can be used for comparing 2 separate text files.

Our current AngularJS app, which we're upgrading, uses Ace-Diff which works well. Yet I can't find anyone who's successfully used an Angular2 version of Ace-Diff, or PrettyDiff, etc.

3
  • 5
    I'm confused. Angular 2+ !== AngularJS 1.7. Commented Dec 19, 2018 at 10:12
  • 1
    @DavidWalschots: By Angular 2+ I'm referring to anything post AngularJS. As you probably know, after their first javascript version, the Angular team rewrote their framework to a TextScript / componentized version. I called it Angular 1.7 but I think that's wrong, editing to Angular 7. Commented Dec 20, 2018 at 0:22
  • @paiego does this mean the "AngularJS" tag should also be removed since it says it should not be used for versions 2 or later? Commented Feb 15, 2019 at 3:54

1 Answer 1

3

You have currently have two options:

  1. You use ngx-diff See npm
  2. You implement your own Component using a 3rd-party-library like google-diff-match-patch

ngx-diff's Fetaures are pretty limited and im not sure how the styling works so you maybe wanna build your own for flexibility.

Be a Hero and publish it to npm so everyone can use it.

Sign up to request clarification or add additional context in comments.

4 Comments

I'm surprised no one has migrated this. I'd love to be the hero but don't have much time for that ;)
You can still use the google-diff-match-patch as third-party-library in angular.
I implemented ngx-diff it only has line by line diff. side by side is more readable.. so it has limited features.
Version v8.0.0 of ngx-diff now contains a side-by-side diff.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.