From 20731aa5089c4df3903ab1b6fb2ad8442ac9273d Mon Sep 17 00:00:00 2001 From: "Howard.Zuo" Date: Thu, 21 Jun 2018 20:48:52 +0800 Subject: [PATCH] fix: add guard check while changing MapOptions --- lib/components/map.component.ts | 3 +++ lib/package.json | 2 +- package.json | 16 ++++++++-------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/components/map.component.ts b/lib/components/map.component.ts index e2b0652..a83458d 100755 --- a/lib/components/map.component.ts +++ b/lib/components/map.component.ts @@ -83,6 +83,9 @@ export class MapComponent implements OnInit, OnChanges { public ngOnChanges(changes: { [propertyName: string]: SimpleChange }) { const opts = changes.options.currentValue as MapOptions + if (!opts) { + return console.warn('MapOptions change was ignored since you are passing empty value') + } this._service.setOptions(opts) } diff --git a/lib/package.json b/lib/package.json index e86799a..b792e43 100755 --- a/lib/package.json +++ b/lib/package.json @@ -1,6 +1,6 @@ { "name": "angular2-baidu-map", - "version": "4.3.1", + "version": "4.3.2", "license": "GPL-3.0", "description": "Angular2 component for Baidu map", "author": "Howard.Zuo", diff --git a/package.json b/package.json index e16adce..ba55b62 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular2-baidu-map", - "version": "4.3.1", + "version": "4.3.2", "license": "GPL-3.0", "scripts": { "start": "ng serve", @@ -16,20 +16,20 @@ "@angular/platform-browser": "^5.2.11", "@angular/platform-browser-dynamic": "^5.2.11", "@angular/router": "^5.2.11", - "core-js": "^2.5.6", - "rxjs": "^5.5.10", + "core-js": "^2.5.7", + "rxjs": "^5.5.11", "zone.js": "^0.8.26" }, "devDependencies": { "@angular/cli": "^1.7.4", "@angular/compiler-cli": "^5.2.11", - "@types/node": "^6.0.110", + "@types/node": "^10.3.4", "codelyzer": "^4.3.0", "highlight.js": "^9.12.0", - "ng-packagr": "^2.4.5", - "prettier": "^1.12.1", - "tslint": "~5.9.1", - "tslint-config-prettier": "^1.12.0", + "ng-packagr": "^3.0.3", + "prettier": "^1.13.5", + "tslint": "~5.10.0", + "tslint-config-prettier": "^1.13.0", "tslint-plugin-prettier": "^1.3.0", "typescript": "~2.6.2" }