Hi @kok,
Try below snip of code.
<script cam-script type="text/form-script">
inject([ '$rootScope', '$scope', 'camAPI', function($rootScope, $scope, camAPI) {
var userName = $rootScope.authentication.name;
var User = camAPI.resource('user');
User.profile({id: userName}, function(err, data) {
if (!err) {
//alert('Data: ' + JSON.stringify(data));
alert('Email: ' + data.email);
}
});
}]);
</script>