
Security News
High Salaries No Longer Enough to Attract Top Cybersecurity Talent
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
ng-diff-match-patch
Advanced tools
This is a port of the angular-diff-match-patch wrapper for AngularJS.
npm install ng-diff-match-patch --save-dev
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
<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:
ins{
color: black;
background: #bbffbb;
}
del{
color: black;
background: #ffbbbb;
}
Got any improvements you'd like to make to this module? Submit a pull request and I will review and merge.
FAQs
A Diff-Match-Patch component for your Angular 2 + applications
The npm package ng-diff-match-patch receives a total of 2,336 weekly downloads. As such, ng-diff-match-patch popularity was classified as popular.
We found that ng-diff-match-patch demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.
Security News
Corepack will be phased out from future Node.js releases following a TSC vote.