I have followed instructions to get the current logged in user in an Angular module using the userService.
angular.module("umbraco").controller("CustomWelcomeDashboardController", function ($scope, userService) {
var vm = this;
vm.UserName = 'guest';
var user = userService.getCurrentUser().then(function (user) {
vm.UserName = user.name;
});
});
This works fine but I can't find any documentation for the getCurrentUser method. I want to know more about what it returns so I can access other data etc.
There is nothing in the UI docs or Core.Services docs . Please, can someone point me in the right direction?
I think your best bet is to put a breakpoint on the code inside Chrome developer tools, and inspect the object you get back, as a reference this is what is on my user account for a site i am currently working on
Angular GetCurrentUser Documentation
I have followed instructions to get the current logged in user in an Angular module using the
userService
.This works fine but I can't find any documentation for the
getCurrentUser
method. I want to know more about what it returns so I can access other data etc.There is nothing in the UI docs or Core.Services docs . Please, can someone point me in the right direction?
Hi Tim,
I think your best bet is to put a breakpoint on the code inside Chrome developer tools, and inspect the object you get back, as a reference this is what is on my user account for a site i am currently working on
Hi Kevin,
Thanks for this workaround. It does help. Hopefully, the documentation will be updated soon.
is working on a reply...