sn-avatar

nickc1
Tera Contributor

I want to configure the style of the avatar via the sn-avatar directive, but I can't find it in the Service Portal/Angular Provider module.  This is not surprising to me, but I have no idea where else to look.

Can anyone guide me to where this, and presumably all the other built in directives exist please?

4 REPLIES 4

DrewW
Mega Sage
Mega Sage

This is a directive that you have to look at by downloading the angular script from the instance and then looking over the code.  You cannot customize it, all you can do is copy what SN did and make your own directive.

Client script on my instance shows the code is here
/*! RESOURCE: /scripts/sn/common/avatar/directive.snAvatar.js */

There is more than just that but you can open the dev tools for the browser you are using and look at the whole thing there.

Thanks Drew.  Can you tell me how you identified the location of the script on the instance, particularly how you found it via the client script editor?

The dev tools for the browser show you the script sources, so when you open a portal it will be all in one file.  I made a copy and put it thru a javascript formatter.  You will see at that point there are comments every now and then that give the path to the file.

In Edge I hit F12, then go to the Debugger tab and look at the files it downloaded in the script folder.  Its fairly obvious which one has all of the angular directives in it.

 

Alex441
Tera Contributor

 

<sn-avatar class="avatar-large" primary="user.sys_id" alt="Profile Image"></sn-avatar>