Skip to content

Commit 472e6a3

Browse files
authored
Merge pull request #45 from rars/angular-update
2 parents 8a8761e + 0926d16 commit 472e6a3

16 files changed

+3827
-2641
lines changed

CHANGELOG.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,32 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5-
## [4.0.0](https://github.com/rars/ngx-diff/compare/v3.0.0...v4.0.0) (2023-05-07)
5+
## [5.0.0](https://github.com/rars/ngx-diff/compare/v4.0.0...v5.0.0) (2023-05-07)
6+
7+
### Features
68

9+
- **ngx-diff:** convert components/pipes to standalone, remove `NgxDiffModule` ([712a34b](https://github.com/rars/ngx-diff/commit/712a34bc02dc33b2ec02a163409417c4334d020a))
10+
- **ngx-diff:** update to Angular 16 ([6e79821](https://github.com/rars/ngx-diff/commit/6e79821b6a78f7cd750ae29d4c63a895cb97b19d))
11+
12+
## [4.0.0](https://github.com/rars/ngx-diff/compare/v3.0.0...v4.0.0) (2023-05-07)
713

814
### Features
915

10-
* **ngx-diff:** update to Angular 15 ([16de002](https://github.com/rars/ngx-diff/commit/16de0025724e6888ddd06308e6a8cabecf685210))
16+
- **ngx-diff:** update to Angular 15 ([16de002](https://github.com/rars/ngx-diff/commit/16de0025724e6888ddd06308e6a8cabecf685210))
1117

1218
## [3.0.0](https://github.com/rars/ngx-diff/compare/v2.0.0...v3.0.0) (2023-05-07)
1319

14-
1520
### Features
1621

17-
* **ngx-diff:** add CSS variables for customising appearance of diff ([5b4b818](https://github.com/rars/ngx-diff/commit/5b4b81803aae4a7b210babfd5478158022122238))
18-
* **ngx-jwt:** add selectedLineChange output event and allow lines to be selected ([002e8db](https://github.com/rars/ngx-diff/commit/002e8dbb0db765edc8d578c6c507f0420d84b9a1))
19-
* **ngx-jwt:** mark DiffMatchPatchService as providedIn root ([dd13fab](https://github.com/rars/ngx-diff/commit/dd13fabeedb8546bdc0f0c1bacc33cbaca06d682))
22+
- **ngx-diff:** add CSS variables for customising appearance of diff ([5b4b818](https://github.com/rars/ngx-diff/commit/5b4b81803aae4a7b210babfd5478158022122238))
23+
- **ngx-jwt:** add selectedLineChange output event and allow lines to be selected ([002e8db](https://github.com/rars/ngx-diff/commit/002e8dbb0db765edc8d578c6c507f0420d84b9a1))
24+
- **ngx-jwt:** mark DiffMatchPatchService as providedIn root ([dd13fab](https://github.com/rars/ngx-diff/commit/dd13fabeedb8546bdc0f0c1bacc33cbaca06d682))
2025

2126
## [2.0.0](https://github.com/rars/ngx-diff/compare/v1.0.0...v2.0.0) (2023-05-06)
2227

23-
2428
### Features
2529

26-
* **ngx-diff:** update to Angular 14 ([e95fbaa](https://github.com/rars/ngx-diff/commit/e95fbaaf5b52ad40a3e519ec0d8f5a11ac5a60c8))
30+
- **ngx-diff:** update to Angular 14 ([e95fbaa](https://github.com/rars/ngx-diff/commit/e95fbaaf5b52ad40a3e519ec0d8f5a11ac5a60c8))
2731

2832
## [1.0.0](https://github.com/rars/ngx-diff/compare/v0.4.0...v1.0.0) (2022-03-21)
2933

README.md

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ Angular component library for displaying diffs of text. [Demo](https://rars.gith
1010
```
1111
npm install ngx-diff diff-match-patch-ts --save
1212
```
13-
2. Import `NgxDiffModule` to your app:
13+
2. Either:
14+
15+
2.1. If you are using this component in an NgModule-based setting, add `InlineDiffComponent` to your module's `imports`:
1416

1517
```typescript
16-
import { NgxDiffModule } from 'ngx-diff';
18+
import { InlineDiffComponent } from 'ngx-diff';
1719

1820
import { NgModule } from '@angular/core';
1921
import { BrowserModule } from '@angular/platform-browser';
@@ -22,16 +24,35 @@ Angular component library for displaying diffs of text. [Demo](https://rars.gith
2224

2325
@NgModule({
2426
declarations: [AppComponent],
25-
imports: [BrowserModule, NgxDiffModule],
27+
imports: [BrowserModule, InlineDiffComponent],
2628
providers: [],
2729
bootstrap: [AppComponent],
2830
})
2931
export class AppModule {}
3032
```
3133

34+
2.2. Or if you are using this component in a standalone component setting, add `InlineDiffComponent` to your component's `imports`:
35+
36+
```typescript
37+
import { InlineDiffComponent } from 'ngx-diff';
38+
39+
import { Component } from '@angular/core';
40+
41+
@Component({
42+
selector: 'app-root',
43+
templateUrl: './app.component.html',
44+
styleUrls: ['./app.component.scss'],
45+
standalone: true,
46+
imports: [InlineDiffComponent],
47+
})
48+
export class AppComponent {
49+
// ...
50+
}
51+
```
52+
3253
3. Use the `inline-diff` component by setting the `oldText` and `newText` attributes:
3354
```HTML
34-
<inline-diff [oldText]="oldDocumentContents" [newText]="newDocumentContents" [lineContextSize]="4"></inline-diff>
55+
<inline-diff [oldText]="oldDocumentContents" [newText]="newDocumentContents" [lineContextSize]="4" />
3556
```
3657

3758
## Theming
@@ -67,7 +88,7 @@ Then use this class in your desired component in your HTML template:
6788
[newText]="newText"
6889
[lineContextSize]="4"
6990
style="width: 100%"
70-
(selectedLineChange)="selectedLineChange($event)"></inline-diff>
91+
(selectedLineChange)="selectedLineChange($event)" />
7192
```
7293

7394
It is recommended to use these settings rather than attempt to override styles based upon DOM structure or class names that are internal details that may change.
@@ -83,6 +104,7 @@ It is recommended to use these settings rather than attempt to override styles b
83104
| 14 | 2.0.0 |
84105
| 14 | 3.0.0 |
85106
| 15 | 4.0.0 |
107+
| 16 | 5.0.0 |
86108

87109
## Contributions welcome!
88110

0 commit comments

Comments
 (0)