Forum Discussion
This content isn't available powerBi and angular
What error do you get in the console/network tab in your browser developer mode(F12)? I don't know Angular, I used to test with a static HTML as below. Try to debug your .NET code and test by replacing the { } in below HTML.
<html>
<script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/jquery/dist/jquery.js"></script>
<script src="powerbi.js"></script>
<script type="text/javascript">
window.onload = function () {
// Read embed application token from Model
var accessToken = "{embed token starts with H4sIA here}";
// Read embed URL from Model
var embedUrl = "https://app.powerbi.com/reportEmbed?reportId={report id}&groupId={group id}";
// Read dashboard Id from Model
var embedReportId = "{report id}";
// Get models. models contains enums that can be used.
var models = window['powerbi-client'].models;
// Embed configuration used to describe the what and how to embed.
// This object is used when calling powerbi.embed.
// This also includes settings and options such as filters.
// You can find more information at https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Configuration-Details.
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 reportContainer = $('#reportContainer')[0] ;
// Embed the dashboard and display it within the div container.
var reports = powerbi.embed(reportContainer, config);
}
</script>
<div id="reportContainer"></div>
</html>
Thanks Eric for the answer, when i try for the first time to know how it works i try with a simple mvc app and i use that code, my issue was when i change mvc to my angular app. i am getting this error in the console app
GET https://wabi-west-us-redirect.analysis.windows.net/metadata/cluster 403 (Forbidden)
but i don't know what that means, why i am not auth to access
- Eric_Zhang8 years agoMicrosoft Employee
sebastianherrer wrote:
Thanks Eric for the answer, when i try for the first time to know how it works i try with a simple mvc app and i use that code, my issue was when i change mvc to my angular app. i am getting this error in the console app
GET https://wabi-west-us-redirect.analysis.windows.net/metadata/cluster 403 (Forbidden)
but i don't know what that means, why i am not auth to access
What are the request details of the 403 request? You could find the 403 network traffic in the netwokr tab next next to console app.
- sebastianherrer8 years agoRegular Visitor
These are the data that i can obtain from the network trafic tab. i am not allowed to ask for the report but i dont know why. because in a mvc app i was able to do it