1.0.8 • Published 4 years ago

diff-viewer v1.0.8

Weekly downloads
18
License
-
Repository
-
Last release
4 years ago

DiffViewer

DiffViewer is an Angular Pipe for comparing objects.

Usage

First of all install:

npm install diff-viewer

Import Diff2Html styles in your angular.json:

"styles": [
    ...
    "./node_modules/diff2html/bundles/css/diff2html.min.css"
],

Import DiffViewerModule in your module where you want to use the pipe:

import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { DiffViewerModule } from 'diff-viewer'
import { AppComponent } from './app.component'

@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule, DiffViewerModule],
  providers: [],
  bootstrap: [AppComponent],
})

export class AppModule {}

Then use the pipe with the innerHtml tag:

<div [innerHtml]="firstObject | diffViewer: secondObject"></div>

Built With

  • Diff - Used for generating unified diff
  • Diff2HTML - Used for display the differences
1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago