⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.72
Server IP:
41.128.143.86
Server:
Linux host.raqmix.cloud 6.8.0-1025-azure #30~22.04.1-Ubuntu SMP Wed Mar 12 15:28:20 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.3.23
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
grafana
/
public
/
app
/
angular
/
services
/
View File Name :
dynamic_directive_srv.ts
import angular from 'angular'; import coreModule from '../core_module'; class DynamicDirectiveSrv { static $inject = ['$compile']; constructor(private $compile: angular.ICompileService) {} addDirective(element: any, name: string, scope: any) { const child = angular.element(document.createElement(name)); this.$compile(child)(scope); element.empty(); element.append(child); } link(scope: any, elem: JQLite, attrs: any, options: any) { const directiveInfo = options.directive(scope); if (!directiveInfo || !directiveInfo.fn) { elem.empty(); return; } if (!directiveInfo.fn.registered) { coreModule.directive(attrs.$normalize(directiveInfo.name), directiveInfo.fn); directiveInfo.fn.registered = true; } this.addDirective(elem, directiveInfo.name, scope); } create(options: any) { const directiveDef = { restrict: 'E', scope: options.scope, link: (scope: any, elem: JQLite, attrs: any) => { if (options.watchPath) { let childScope: any = null; scope.$watch(options.watchPath, () => { if (childScope) { childScope.$destroy(); } childScope = scope.$new(); this.link(childScope, elem, attrs, options); }); } else { this.link(scope, elem, attrs, options); } }, }; return directiveDef; } } coreModule.service('dynamicDirectiveSrv', DynamicDirectiveSrv);