Skip to content

Commit 85a08f8

Browse files
committed
updated tyoes
1 parent 05c940b commit 85a08f8

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

src/app/app.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
<h1>Metabase Dashboards</h1>
88

99
<procedural-dashboard
10-
dashboardId="1"
11-
withTitle="true"
12-
withDownloads="false"
13-
drills="true">
10+
[dashboardId]="1"
11+
[withTitle]="true"
12+
[withDownloads]="false"
13+
[drills]="true">
1414
</procedural-dashboard>
1515

1616
<declarative-dashboard
17-
dashboardId="2"
18-
withTitle="false"
19-
withDownloads="true"
20-
drills="false">
17+
[dashboardId]="2"
18+
[withTitle]="false"
19+
[withDownloads]="true"
20+
[drills]="false">
2121
</declarative-dashboard>
2222
</div>
2323
</main>

src/app/declarative-dashboard.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ import { Component, CUSTOM_ELEMENTS_SCHEMA, Input } from '@angular/core';
2929
schemas: [CUSTOM_ELEMENTS_SCHEMA]
3030
})
3131
export class DeclarativeDashboardComponent {
32-
@Input() dashboardId: string = '1';
33-
@Input() withTitle: string = 'true';
34-
@Input() withDownloads: string = 'false';
35-
@Input() drills: string = 'true';
32+
@Input() dashboardId: number = 1;
33+
@Input() withTitle: boolean = true;
34+
@Input() withDownloads: boolean = false;
35+
@Input() drills: boolean = true;
3636
}

src/app/procedural-dashboard.component.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ import { Component, OnInit, ElementRef, Renderer2, Input } from '@angular/core';
2222
`]
2323
})
2424
export class ProceduralDashboardComponent implements OnInit {
25-
@Input() dashboardId: string = '1';
26-
@Input() withTitle: string = 'true';
27-
@Input() withDownloads: string = 'false';
28-
@Input() drills: string = 'true';
25+
@Input() dashboardId: number = 1;
26+
@Input() withTitle: boolean = true;
27+
@Input() withDownloads: boolean = false;
28+
@Input() drills: boolean = true;
2929

3030
constructor(private elementRef: ElementRef, private renderer: Renderer2) {}
3131

@@ -37,10 +37,10 @@ export class ProceduralDashboardComponent implements OnInit {
3737
const container = this.elementRef.nativeElement.querySelector('#metabase-container');
3838
if (container) {
3939
const dashboard = this.renderer.createElement('metabase-dashboard');
40-
this.renderer.setAttribute(dashboard, 'dashboard-id', this.dashboardId);
41-
this.renderer.setAttribute(dashboard, 'with-title', this.withTitle);
42-
this.renderer.setAttribute(dashboard, 'with-downloads', this.withDownloads);
43-
this.renderer.setAttribute(dashboard, 'drills', this.drills);
40+
this.renderer.setAttribute(dashboard, 'dashboard-id', String(this.dashboardId));
41+
this.renderer.setAttribute(dashboard, 'with-title', String(this.withTitle));
42+
this.renderer.setAttribute(dashboard, 'with-downloads', String(this.withDownloads));
43+
this.renderer.setAttribute(dashboard, 'drills', String(this.drills));
4444
this.renderer.appendChild(container, dashboard);
4545
}
4646
}

0 commit comments

Comments
 (0)