Skip to content

Commit

Permalink
feat(share-map-tool): pass options to the component
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarbeau committed Feb 28, 2018
1 parent 04ff16e commit 531b188
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/lib/tool/tools/share-map-tool/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './share-map-tool.component';
export * from './share-map-tool.interface';
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
<igo-share-map igoShareMapBinding></igo-share-map>
<igo-share-map
igoShareMapBinding
[hasCopyLinkButton]="hasCopyLinkButton"
[hasShareMapButton]="hasShareMapButton"
></igo-share-map>
14 changes: 14 additions & 0 deletions src/lib/tool/tools/share-map-tool/share-map-tool.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { Component } from '@angular/core';

import { Register } from '../../shared';

import { ShareMapToolOptions } from './share-map-tool.interface';


@Register({
name: 'shareMap',
Expand All @@ -15,6 +17,18 @@ import { Register } from '../../shared';
})
export class ShareMapToolComponent {

public options: ShareMapToolOptions = {};

get hasCopyLinkButton(): boolean {
return this.options.hasCopyLinkButton === undefined ?
false : this.options.hasCopyLinkButton;
}

get hasShareMapButton(): boolean {
return this.options.hasShareMapButton === undefined ?
false : this.options.hasShareMapButton;
}

constructor() { }

}
4 changes: 4 additions & 0 deletions src/lib/tool/tools/share-map-tool/share-map-tool.interface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface ShareMapToolOptions {
hasCopyLinkButton?: boolean;
hasShareMapButton?: boolean;
}

0 comments on commit 531b188

Please sign in to comment.