Skip to content

Commit

Permalink
fix for ngOnDestroy throws error when in SSR - resolves #163 (#263)
Browse files Browse the repository at this point in the history
fix for ngOnDestroy throws error when in SSR - resolves #163
  • Loading branch information
vlio20 authored Oct 21, 2017
1 parent 8976873 commit c2a0c8b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file.
- Stop using getters in template ([3858dde](https://github.com/vlio20/angular-datepicker/commit/3858dde)) closes [#239](https://github.com/vlio20/angular-datepicker/issues/239)

### Bug Fixed
- fix for `ngOnDestroy` throws error when in SSR ([???](https://github.com/vlio20/angular-datepicker/commit/???)) closes [#163](https://github.com/vlio20/angular-datepicker/issues/163)
- `displayDate` on the directive bug fix ([984aab8](https://github.com/vlio20/angular-datepicker/commit/984aab8)) closes [#254](https://github.com/vlio20/angular-datepicker/issues/254)
- `max`/`min` date support for strings ([ad98d1b](https://github.com/vlio20/angular-datepicker/commit/ad98d1b)) closes [#250](https://github.com/vlio20/angular-datepicker/issues/250)
- `value.split` is not a function bug fix ([38f6ce2](https://github.com/vlio20/angular-datepicker/commit/38f6ce2)) closes [#225](https://github.com/vlio20/angular-datepicker/issues/245)
Expand Down
5 changes: 4 additions & 1 deletion src/app/date-picker/date-picker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,9 @@ export class DatePickerComponent implements OnChanges,

ngOnDestroy() {
this.handleInnerElementClickUnlisteners.forEach(ul => ul());
this.appendToElement.removeChild(this.calendarWrapper);

if (this.appendToElement) {
this.appendToElement.removeChild(this.calendarWrapper);
}
}
}

0 comments on commit c2a0c8b

Please sign in to comment.