Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
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 } 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 1,765 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.