Skip to content

Commit

Permalink
fix: add guard check while changing MapOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
leftstick committed Jun 21, 2018
1 parent 009a969 commit 20731aa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
3 changes: 3 additions & 0 deletions lib/components/map.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
2 changes: 1 addition & 1 deletion lib/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular2-baidu-map",
"version": "4.3.1",
"version": "4.3.2",
"license": "GPL-3.0",
"scripts": {
"start": "ng serve",
Expand All @@ -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"
}
Expand Down

0 comments on commit 20731aa

Please sign in to comment.