ngx-diff2html Demo
-
+
@@ -10,11 +13,21 @@
-
+
-
+
@@ -25,9 +38,17 @@
-
-
-
+
+
+
@@ -40,5 +61,8 @@
>
- Made with ♥️ by AXeL
+ Made with ♥️ by
+ AXeL
diff --git a/projects/demo/src/app/app.module.ts b/projects/demo/src/app/app.module.ts
index ba2839c..11dd494 100644
--- a/projects/demo/src/app/app.module.ts
+++ b/projects/demo/src/app/app.module.ts
@@ -1,36 +1,40 @@
-import { BrowserModule } from '@angular/platform-browser';
-import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { HttpClientModule } from '@angular/common/http';
-import { NgZorroAntdModule, NZ_I18N, en_US } from 'ng-zorro-antd';
+import { FormsModule, ReactiveFormsModule } from "@angular/forms";
+import { NZ_I18N, en_US } from "ng-zorro-antd/i18n";
+import { AppComponent } from "./app.component";
+import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
+import { BrowserModule } from "@angular/platform-browser";
+import { HttpClientModule } from "@angular/common/http";
+import { NgModule } from "@angular/core";
+//import { NgxDiff2htmlModule } from 'ngx-diff2html';
+import { NgxDiff2htmlModule } from "projects/ngx-diff2html/src/public-api";
+import { NzGridModule } from "ng-zorro-antd/grid";
+import { NzInputModule } from "ng-zorro-antd/input";
+import { NzLayoutModule } from "ng-zorro-antd/layout";
+import { NzRadioModule } from "ng-zorro-antd/radio";
+import en from "@angular/common/locales/en";
/** config angular i18n **/
-import { registerLocaleData } from '@angular/common';
-import en from '@angular/common/locales/en';
-registerLocaleData(en);
+import { registerLocaleData } from "@angular/common";
-import { AppComponent } from './app.component';
-//import { NgxDiff2htmlModule } from 'ngx-diff2html';
-import { NgxDiff2htmlModule } from 'projects/ngx-diff2html/src/public-api';
+registerLocaleData(en);
@NgModule({
- declarations: [
- AppComponent
- ],
+ declarations: [AppComponent],
imports: [
BrowserModule,
FormsModule,
HttpClientModule,
BrowserAnimationsModule,
- /** import ng-zorro-antd root module,you should import NgZorroAntdModule and avoid importing sub modules directly **/
- NgZorroAntdModule,
- NgxDiff2htmlModule
+ NzLayoutModule,
+ NzGridModule,
+ NzInputModule,
+ NzRadioModule,
+ NgxDiff2htmlModule,
],
providers: [
/** config ng-zorro-antd i18n (language && date) **/
- { provide: NZ_I18N, useValue: en_US }
+ { provide: NZ_I18N, useValue: en_US },
],
- bootstrap: [AppComponent]
+ bootstrap: [AppComponent],
})
-export class AppModule { }
+export class AppModule {}
diff --git a/projects/demo/src/environments/environment.ts b/projects/demo/src/environments/environment.ts
index 7b4f817..30d7bcc 100644
--- a/projects/demo/src/environments/environment.ts
+++ b/projects/demo/src/environments/environment.ts
@@ -13,4 +13,4 @@ export const environment = {
* This import should be commented out in production mode because it will have a negative impact
* on performance if an error is thrown.
*/
-// import 'zone.js/dist/zone-error'; // Included with Angular CLI.
+// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
diff --git a/projects/demo/src/polyfills.ts b/projects/demo/src/polyfills.ts
index 5c4e0c4..a7e6c96 100644
--- a/projects/demo/src/polyfills.ts
+++ b/projects/demo/src/polyfills.ts
@@ -18,16 +18,6 @@
* BROWSER POLYFILLS
*/
-/** IE10 and IE11 requires the following for NgClass support on SVG elements */
-// import 'classlist.js'; // Run `npm install --save classlist.js`.
-
-/**
- * Web Animations `@angular/platform-browser/animations`
- * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
- * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
- */
-// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
-
/**
* By default, zone.js will patch all possible macroTask and DomEvents
* user can disable parts of macroTask/DomEvents patch by setting following flags
@@ -55,7 +45,7 @@
/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
-import 'zone.js/dist/zone'; // Included with Angular CLI.
+import 'zone.js'; // Included with Angular CLI.
/***************************************************************************************************
diff --git a/projects/demo/src/test.ts b/projects/demo/src/test.ts
index 1631789..6b03dbe 100644
--- a/projects/demo/src/test.ts
+++ b/projects/demo/src/test.ts
@@ -1,6 +1,6 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
-import 'zone.js/dist/zone-testing';
+import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
@@ -12,7 +12,9 @@ declare const require: any;
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
- platformBrowserDynamicTesting()
+ platformBrowserDynamicTesting(), {
+ teardown: { destroyAfterEach: false }
+}
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
diff --git a/projects/demo/tsconfig.app.json b/projects/demo/tsconfig.app.json
index 4e4da7d..5e275e1 100644
--- a/projects/demo/tsconfig.app.json
+++ b/projects/demo/tsconfig.app.json
@@ -9,7 +9,7 @@
"src/polyfills.ts"
],
"include": [
- "src/**/*.ts"
+ "src/**/*.d.ts"
],
"exclude": [
"src/test.ts",
diff --git a/projects/demo/tslint.json b/projects/demo/tslint.json
deleted file mode 100644
index 19e8161..0000000
--- a/projects/demo/tslint.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "extends": "../../tslint.json",
- "rules": {
- "directive-selector": [
- true,
- "attribute",
- "app",
- "camelCase"
- ],
- "component-selector": [
- true,
- "element",
- "app",
- "kebab-case"
- ]
- }
-}
diff --git a/projects/ngx-diff2html/.eslintrc.json b/projects/ngx-diff2html/.eslintrc.json
new file mode 100644
index 0000000..16e1ec9
--- /dev/null
+++ b/projects/ngx-diff2html/.eslintrc.json
@@ -0,0 +1,38 @@
+{
+ "extends": "../../.eslintrc.json",
+ "ignorePatterns": ["!**/*"],
+ "overrides": [
+ {
+ "files": ["*.ts"],
+ "parserOptions": {
+ "project": [
+ "projects/ngx-diff2html/tsconfig.lib.json",
+ "projects/ngx-diff2html/tsconfig.spec.json"
+ ],
+ "createDefaultProgram": true
+ },
+ "rules": {
+ "@angular-eslint/directive-selector": [
+ "error",
+ {
+ "type": "attribute",
+ "prefix": "ngx",
+ "style": "camelCase"
+ }
+ ],
+ "@angular-eslint/component-selector": [
+ "error",
+ {
+ "type": "element",
+ "prefix": "ngx",
+ "style": "kebab-case"
+ }
+ ]
+ }
+ },
+ {
+ "files": ["*.html"],
+ "rules": {}
+ }
+ ]
+}
diff --git a/projects/ngx-diff2html/ng-package.json b/projects/ngx-diff2html/ng-package.json
index 85f308e..82dffce 100644
--- a/projects/ngx-diff2html/ng-package.json
+++ b/projects/ngx-diff2html/ng-package.json
@@ -2,16 +2,7 @@
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/ngx-diff2html",
"lib": {
- "entryFile": "src/public-api.ts",
- "umdModuleIds": {
- "diff-match-patch": "diff-match-patch",
- "diff2html": "diff2html",
- "path": "path"
- }
+ "entryFile": "src/public-api.ts"
},
- "whitelistedNonPeerDependencies": [
- "diff-match-patch",
- "diff2html",
- "path"
- ]
-}
\ No newline at end of file
+ "allowedNonPeerDependencies": ["diff-match-patch", "diff2html", "path"]
+}
diff --git a/projects/ngx-diff2html/package.json b/projects/ngx-diff2html/package.json
index b83d324..0783420 100644
--- a/projects/ngx-diff2html/package.json
+++ b/projects/ngx-diff2html/package.json
@@ -18,7 +18,8 @@
"dependencies": {
"diff-match-patch": "^1.0.4",
"diff2html": "^3.0.0",
- "path": "^0.12.7"
+ "path": "^0.12.7",
+ "tslib": "^2.0.0"
},
"peerDependencies": {
"@angular/common": "^8.2.14",
diff --git a/projects/ngx-diff2html/src/lib/ngx-diff2html.component.spec.ts b/projects/ngx-diff2html/src/lib/ngx-diff2html.component.spec.ts
index 803bc32..9865125 100644
--- a/projects/ngx-diff2html/src/lib/ngx-diff2html.component.spec.ts
+++ b/projects/ngx-diff2html/src/lib/ngx-diff2html.component.spec.ts
@@ -1,25 +1,25 @@
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { ComponentFixture, TestBed, async } from "@angular/core/testing";
-import { NgxDiff2htmlComponent } from './ngx-diff2html.component';
+import { NgxDiff2htmlComponent } from "./ngx-diff2html.component";
+import { SafePipe } from "../pipes/safe.pipe";
-describe('NgxDiff2htmlComponent', () => {
+describe("NgxDiff2htmlComponent", () => {
let component: NgxDiff2htmlComponent;
let fixture: ComponentFixture