feat(frontend): modernize Angular app
This commit is contained in:
17
ui/src/app/services/metube-socket.service.ts
Normal file
17
ui/src/app/services/metube-socket.service.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { Injectable, inject } from '@angular/core';
|
||||
import { ApplicationRef } from '@angular/core';
|
||||
import { Socket } from 'ngx-socket-io';
|
||||
|
||||
@Injectable(
|
||||
{ providedIn: 'root' }
|
||||
)
|
||||
export class MeTubeSocket extends Socket {
|
||||
|
||||
constructor() {
|
||||
const appRef = inject(ApplicationRef);
|
||||
|
||||
const path =
|
||||
document.location.pathname.replace(/share-target/, '') + 'socket.io';
|
||||
super({ url: '', options: { path } }, appRef);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user