Hello everyone,
I do not understand very well the notation for this function: function (portalUser){
The parameter "portalUser" where is it populated and declared?
Is there any online converted that changes from AMD to other structure easier to read?
This function is used in this sample: https://developers.arcgis.com/javascript/3/jssamples/portal_oauth_inline.html
Thanks
function displayItems(){
new arcgisPortal.Portal(info.portalUrl).signIn().then(
function (portalUser){
console.log("Signed in to the portal: ", portalUser);
domAttr.set("userId", "innerHTML", portalUser.fullName);
domStyle.set("anonymousPanel", "display", "none");
domStyle.set("personalizedPanel", "display", "block");
queryPortal(portalUser);
}
).otherwise(
function (error){
console.log("Error occurred while signing in: ", error);
}
);
Solved! Go to Solution.
The final code:
var portal = new arcgisPortal.Portal('http://[myorganization].maps.arcgis.com');
portal.signIn().then(function (loggedInUser) {
console.log("Signed in to the portal: ", loggedInUser);
console.log(loggedInUser.fullName);
var myArray = null;
var myArray = loggedInUser.getGroups;
loggedInUser.getGroups().then(function (groups) {
array.forEach(groups, function (group) {
var title = group.title;
console.log(title);
});
});
});