ng-diff-match-patch
Advanced tools
Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "ng-diff-match-patch", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "A Diff-Match-Patch component for your Angular 2 + applications", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Ng-Diff-Match-Patch | ||
===================== | ||
This is a port of the angualr-diff-match-patch wrapper for AngularJS. | ||
This is a port of the angular-diff-match-patch wrapper for AngularJS. | ||
@@ -14,11 +14,47 @@ ## Installation | ||
to be added... | ||
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. | ||
~~~ | ||
<pre line-diff></pre> | ||
<h1>{{left}}</h1> | ||
<h1>{{right}}</h1> | ||
<pre diff [left]="left" [right]="right"></pre> | ||
~~~ | ||
This should produce something like so: | ||
![ng-diff-match-patch](https://tutorialedge.net/uploads/ngDiffMatchPatch.png) | ||
## Development | ||
@@ -25,0 +61,0 @@ |
84270
68