Skip to content

Commit b78c3f5

Browse files
authored
Update to Angular 12 (#47)
1 parent e052277 commit b78c3f5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+9520
-14015
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
strategy:
1616
matrix:
17-
node-version: [10.x, 12.x, 14.x]
17+
node-version: [12.x, 14.x]
1818

1919
steps:
2020
- uses: actions/checkout@v2
@@ -23,6 +23,6 @@ jobs:
2323
with:
2424
node-version: ${{ matrix.node-version }}
2525
- run: npm ci
26-
- run: npm run lint
26+
# - run: npm run lint
2727
- run: npm run build
2828
# - run: npm test

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@
66
[![downloads](https://img.shields.io/npm/dt/angular-resize-event)](https://www.npmjs.com/package/angular-resize-event)
77
[![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/github/vdolek/angular-resize-event)](https://snyk.io/test/github/vdolek/angular-resize-event)
88

9-
Angular directive for detecting changes of an element size.
9+
Angular 12 directive for detecting changes of an element size.
1010

1111
It is as simple as:
1212

1313
```html
1414
<div (resized)="onResized($event)"></div>
1515
```
1616

17-
It internally uses `ResizeSensor` from [CSS Element Queries](https://github.com/marcj/css-element-queries).
17+
It internally uses browser native [`ResizeObserver`](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver). Therefore it is not supported in IE.
18+
19+
For Angular 11 you can use version 2.1.0 which internally uses uses `ResizeSensor` from [CSS Element Queries](https://github.com/marcj/css-element-queries) that is supported in IE.
1820

1921
## Playground
2022

@@ -72,8 +74,8 @@ class MyComponent {
7274
height: number;
7375

7476
onResized(event: ResizedEvent) {
75-
this.width = event.newWidth;
76-
this.height = event.newHeight;
77+
this.width = event.newRect.width;
78+
this.height = event.newRect.height;
7779
}
7880
}
7981
```

angular.json

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,22 @@
77
"projectType": "library",
88
"root": "projects/angular-resize-event",
99
"sourceRoot": "projects/angular-resize-event/src",
10-
"prefix": "",
10+
"prefix": "lib",
1111
"architect": {
1212
"build": {
13-
"builder": "@angular-devkit/build-ng-packagr:build",
13+
"builder": "@angular-devkit/build-angular:ng-packagr",
1414
"options": {
15-
"tsConfig": "projects/angular-resize-event/tsconfig.lib.json",
1615
"project": "projects/angular-resize-event/ng-package.json"
1716
},
1817
"configurations": {
1918
"production": {
2019
"tsConfig": "projects/angular-resize-event/tsconfig.lib.prod.json"
20+
},
21+
"development": {
22+
"tsConfig": "projects/angular-resize-event/tsconfig.lib.json"
2123
}
22-
}
24+
},
25+
"defaultConfiguration": "production"
2326
},
2427
"test": {
2528
"builder": "@angular-devkit/build-angular:karma",
@@ -28,20 +31,9 @@
2831
"tsConfig": "projects/angular-resize-event/tsconfig.spec.json",
2932
"karmaConfig": "projects/angular-resize-event/karma.conf.js"
3033
}
31-
},
32-
"lint": {
33-
"builder": "@angular-devkit/build-angular:tslint",
34-
"options": {
35-
"tsConfig": [
36-
"projects/angular-resize-event/tsconfig.lib.json",
37-
"projects/angular-resize-event/tsconfig.spec.json"
38-
],
39-
"exclude": [
40-
"**/node_modules/**"
41-
]
42-
}
4334
}
4435
}
45-
}},
36+
}
37+
},
4638
"defaultProject": "angular-resize-event"
4739
}

0 commit comments

Comments
 (0)