Catch the event (e.g. ng-click) by your own handler. Then you get the current event target and traverse to its top ui-card-panel element. The id of the ui-card-panel is like
< tab name >_< group_name >
You can send this information to NR
This is an example:
[
{
"id": "e3947d5bbc316eda",
"type": "tab",
"label": "Flow 3",
"disabled": false,
"info": "",
"env": []
},
{
"id": "f7f49c8728b85a22",
"type": "debug",
"z": "e3947d5bbc316eda",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 730,
"y": 360,
"wires": []
},
{
"id": "bbd264562450abf6",
"type": "ui_template",
"z": "e3947d5bbc316eda",
"group": "30e064314a04f0bd",
"name": "",
"order": 2,
"width": 0,
"height": 0,
"format": "<style>\n .button-ripple{\n overflow:hidden;\n width:100%;\n height:100%;\n left:0;\n top: 0;\n position:absolute;\n display:block;\n z-index:1;\n border-radius: inhirit;\n background-clip: padding-box;\n background-color: rgba(255,255,255,0);\n transition: all 0.55s cubic-bezier(0,0,0.6,1) ;\n -webkit-transform: translateZ(1);\n }\n .button-ripple:active{\n left:50%;\n width:0%;\n background-color: rgba(255,255,255,0.1);\n transition: all 0s;\n }\n</style>\n\n<div class=\"nr-dashboard-button\">\n <md-tooltip md-direction=\"center\">My Button</md-tooltip>\n <button id=\"myButton_ccd3e21e\" class=\"md-raised md-button md-ink-ripple\" type=\"button\" ng-click=\"OnButtonClick($event)\" aria-label=\"mybutton\">\n <span>my Label</span>\n <div class=\"button-ripple\"></div>\n </button>\n</div>\n<script type=\"text/javascript\">\n \n(function(scope) {\n scope.OnButtonClick = function(evt){\n const cardPanelElement = evt.currentTarget.closest('ui-card-panel');\n const arrNames = cardPanelElement.id.split('_');\n objPayload = {};\n objPayload.tab = arrNames[0];\n objPayload.group = arrNames[1];\n scope.send({payload: objPayload});\n }\n \n scope.$watch('msg', function(msg) {\n \n });\n})(scope);\n\n</script>\n \n",
"storeOutMessages": false,
"fwdInMessages": false,
"resendOnRefresh": true,
"templateScope": "local",
"className": "",
"x": 520,
"y": 360,
"wires": [
[
"f7f49c8728b85a22"
]
]
},
{
"id": "30e064314a04f0bd",
"type": "ui_group",
"name": "TestGroup",
"tab": "fa0a520e5739912d",
"order": 1,
"disp": true,
"width": "6",
"collapse": false,
"className": ""
},
{
"id": "fa0a520e5739912d",
"type": "ui_tab",
"name": "TestTab",
"icon": "dashboard",
"order": 5,
"disabled": false,
"hidden": false
}
]