New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ng-diff-match-patch

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng-diff-match-patch

A Diff-Match-Patch component for your Angular 2 + applications

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.9K
decreased by-22.48%
Maintainers
1
Weekly downloads
 
Created
Source

Ng-Diff-Match-Patch

This is a port of the angular-diff-match-patch wrapper for AngularJS.

Installation

npm install ng-diff-match-patch --save-dev

Usage

In order to use these directives you'll first have to import them from the module like so:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { AppComponent } from './app.component';
// import our necessary module and components here 
import { DiffMatchPatchModule, DiffDirective } from 'ng-diff-match-patch';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    DiffMatchPatchModule
  ],
  providers: [  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Remember to add DiffMatchPatchModule to your imports array in @NgModule

Basic Usage

Currently only diff works. I will be adding more functionality in the weeks to come.

<h1>{{left}}</h1>

<h1>{{right}}</h1>

<pre diff [left]="left" [right]="right"></pre>

<pre lineDiff [left]="left" [right]="right"></pre>

<pre semanticDiff [left]="left" [right]="right"></pre>

<pre processingDiff [left]="left" [right]="right"></pre>

This should produce something like so:

ng-diff-match-patch

CSS Styles:

ins{
  color: black;
  background: #bbffbb;
}

del{
  color: black;
  background: #ffbbbb;
}

Development

git clone https://github.com/elliotforbes/ng-diff-match-patch

Keywords

FAQs

Package last updated on 18 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc