* Implementation of OnInit lifecycle method * @inheritdoc
()
| 261 | * @inheritdoc |
| 262 | */ |
| 263 | public ngOnInit(): void { |
| 264 | if (!this.componentName) { |
| 265 | // Technically, the `trace` binding should always be provided. |
| 266 | // However, if it is incorrectly declared on the element without a |
| 267 | // value (e.g., `<app-component trace />`), we fall back to using `tagName` |
| 268 | // (which is e.g. `APP-COMPONENT`). |
| 269 | this.componentName = this._host.nativeElement.tagName.toLowerCase(); |
| 270 | } |
| 271 | |
| 272 | if (getActiveSpan()) { |
| 273 | this._tracingSpan = runOutsideAngular(() => |
| 274 | startInactiveSpan({ |
| 275 | name: `<${this.componentName}>`, |
| 276 | op: ANGULAR_INIT_OP, |
| 277 | attributes: { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.angular.trace_directive' }, |
| 278 | }), |
| 279 | ); |
| 280 | } |
| 281 | } |
| 282 | |
| 283 | /** |
| 284 | * Implementation of AfterViewInit lifecycle method |
nothing calls this directly
no test coverage detected