1 parent c2ba347 commit b5d6bb9Copy full SHA for b5d6bb9
1 file changed
src/service.ts
@@ -83,11 +83,11 @@ export class PowerBi {
83
* and automatically attempts to embed a powerbi component based on information from the attributes.
84
* Only runs if `config.autoEmbedOnContentLoaded` is true when the service is created.
85
*/
86
- init(container?: HTMLElement): void {
+ init(container?: HTMLElement, config: embed.IEmbedConfiguration = undefined): embed.Embed[] {
87
container = (container && container instanceof HTMLElement) ? container : document.body;
88
89
const elements = Array.prototype.slice.call(container.querySelectorAll(`[${embed.Embed.embedUrlAttribute}]`));
90
- elements.forEach(element => this.embed(element));
+ return elements.map(element => this.embed(element, config));
91
}
92
93
/**
0 commit comments