How to debug a aura component is running on community or a normal app
Using this code:
Non-Community Debug:

Thanks
Apex Coder
doInit: function(component, event, helper) {
var context = (new RegExp('.*?\/s\/','g')).exec(window.location.href);
var path=(new RegExp(':\/\/(.*\.com)\/([A-Za-z0-9]*\/)?s\/','g')).exec(window.location.href);
context != null ? path[2] == undefined ? '' : path[2] : null;
console.log('###',context);
}
Community Debug:Non-Community Debug:
Thanks
Apex Coder
Comments
Post a Comment