mounir.youssef Posted July 5, 2018 Share Posted July 5, 2018 i have the below method to validate user and then retrieve the resources from jasper server. the user credentials are validated correctly. However, the "v" varialble is always null. please advise. kindly refer me to any typscript documentation for visualizejs.public validateUser(userName: string, password: string, organization: string): Promise<any> { return new Promise(function(resolve, reject) { visualize({ auth: { name: userName, password: password, organization: organization } }, function() { resolve(); }, // successful validation function() { reject(); }, function (v) { console.log(v); v.resourcesSearch({ folderUri: "/public", recursive: true, types: ["reportUnit","dashboard"], }), //utility function function renderResults(results) { this.resourceDetails = results; console.log( this.resourceDetails); } }); });[/code] Link to comment Share on other sites More sharing options...
mounir.youssef Posted July 9, 2018 Author Share Posted July 9, 2018 fixed as below. i guess i had to read more the typescript and angularjs framework:public getressources(): Promise<any> { return new Promise(function(renderResults) { visualize({ // already authenticated, so proceed with resource rendering }, function(v) { v.resourcesSearch({ folderUri: "/public", recursive: true, types: ["reportUnit","dashboard"], success: renderResults, error: handleError }); function renderResults(results) { this.resourceDetails = results; //console.log( this.resourceDetails); }; function handleError(err){ console.log(err.message); this.messageService.log(err.message); } }); })}[/code] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now