Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
I am trying to use the powerbi-client in an angular 4 application, I am getting to following error:
'getPages' does not exist on type 'Embed'.
Any help would be greatly appreciated....thanks in advance.
Here is my code:
______________________________________________________________________________
The getPages works with powerbi-client 2.4.2 in my test, what's going on if you test in below html?
<html>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js"></script>
<script src="powerbi.js"></script>
<script type="text/javascript">
window.onload = function () {
// Read embed application token from Model
var accessToken = "embeded token";
// Read embed URL from Model
var embedUrl = "embed url";
// Read dashboard Id from Model
var embedReportId = "reportid";
// Get models. models contains enums that can be used.
var models = window['powerbi-client'].models;
var config = {
type: 'report',
tokenType: models.TokenType.Embed,
accessToken: accessToken,
embedUrl: embedUrl,
id: embedReportId ,
settings: {
filterPaneEnabled: true
}
};
// Get a reference to the embedded dashboard HTML element
var dashboardContainer = $('#reportContainer')[0] ;
// Embed the dashboard and display it within the div container.
var reports = powerbi.embed(dashboardContainer, config);
reports.on('loaded', function(event)
{
var data = event.detail;
//console.log(JSON.stringify(data, null, ' '));
console.log('****************************************************');
console.log(reports.getPages());
console.log('****************************************************');
})
}
</script>
<div id="reportContainer"></div>
</html>
Thank you for your reply,
I have implemented your suggested code but still getting nothing coming back for "reports.getPages()"...worryingly I'm not getting anything at all in the console window for the data variable even though the "filterPaneEnabled: true" is being applied.
Still getting "Property 'getPages' does not exist on type 'Embed'."
Is this because I am trying to use "powerbi-client" in an Angular 4 application?
Regards
@dpoleon wrote:
Thank you for your reply,
I have implemented your suggested code but still getting nothing coming back for "reports.getPages()"...worryingly I'm not getting anything at all in the console window for the data variable even though the "filterPaneEnabled: true" is being applied.
Still getting "Property 'getPages' does not exist on type 'Embed'."
Is this because I am trying to use "powerbi-client" in an Angular 4 application?
Regards
I don't know Angular. What's going on if you replace the token, embedurl etc in the HTML and open it in Chrome?
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 2 | |
| 1 | |
| 1 |