How to use ngx-socket-io - 4 common examples

To help you get started, we’ve selected a few ngx-socket-io examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github buraksenyurt / saturday-night-works / No 29 - Real Time App with Angular / authorApp / src / app / app.module.ts View on Github external
bildirimleri. Web Socket sunucusunun adresi de konfigurasyon bilgisi olarak tanımlanmakta.
*/
import { SocketIoModule, SocketIoConfig } from 'ngx-socket-io';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
const config: SocketIoConfig = { url: 'http://localhost:5004' };

@NgModule({
  declarations: [
    AppComponent,
    ArticleListComponent,
    ArticleComponent
  ],
  imports: [
    BrowserModule,
    // Üstte belirtilen url bilgisi ile birlikte socket modülünü hazır hale getirip içeri alıyoruz
    SocketIoModule.forRoot(config),
    BrowserAnimationsModule,
    FormsModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
github quead / angular-youtube-player / src / app / components / settings / settings.component.spec.ts View on Github external
beforeEach(async(() => {
		TestBed.configureTestingModule({
			imports: [ReactiveFormsModule, FormsModule, SocketIoModule.forRoot(config)],
			declarations: [SettingsComponent],
			providers: [
				PlayerComponent,
				ButtonsComponent,
				PlaylistControlService,
				SharedService,
				GlobalsService,
				SessionManagerService,
				YoutubeGetVideo,
				HttpClient,
				HttpHandler
			]
		})
			.compileComponents();
	}));
github quead / angular-youtube-player / src / app / app.module.ts View on Github external
import { ModalComponent } from './components/modal/modal.component';
import { ModalService } from './services/modal.service';

const config: SocketIoConfig = { url: environment.serverURL, options: {} };

@NgModule({
	imports: [
		BrowserModule,
		HttpClientModule,
		ReactiveFormsModule,
		FormsModule,
		NguCarouselModule,
		AppRoutingModule,
		DragDropModule,
		SocketIoModule.forRoot(config)
	],
	declarations: [
		AppComponent,
		SettingsComponent,
		SearchComponent,
		AboutComponent,
		HistoryComponent,
		CategoryComponent,
		PlayerComponent,
		PlaylistComponent,
		RelatedComponent,
		RoomComponent,
		YoutubeIframeComponent,
		ButtonsComponent,
		VideoItemComponent,
		CategoryBadgeComponent,
github medtagger / MedTagger / frontend / src / app / services / scan.service.spec.ts View on Github external
import { HttpClient, HttpClientModule, HttpRequest } from '@angular/common/http';
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
import { ScanService } from './scan.service';
import { environment } from '../../environments/environment';
import { Selection3D } from '../model/selections/Selection3D';
import { MedTaggerWebSocket } from './websocket.service';
import { ScanMetadata } from '../model/ScanMetadata';
import { MarkerSlice } from '../model/MarkerSlice';
import { LabelTag } from '../model/labels/LabelTag';
import { of } from 'rxjs';
import { WrappedSocket } from 'ngx-socket-io/src/socket-io.service';
import { SelectedScan } from '../components/upload-scans-selector/upload-scans-selector.component';
import { SelectionMock } from '../mocks/selection.mock';
import { API_URL } from '../utils/ApiUrl';

const fakeMedTaggerSocket: WrappedSocket = new WrappedSocket({url: environment.WEBSOCKET_URL + '/slices'});

describe('Service: ScanService', () => {
    const LABEL_TAG: LabelTag = new LabelTag('MOCK', 'Mock', []);
    const MOCK_SELECTION: SelectionMock = new SelectionMock(1, 'MOCK', LABEL_TAG);

    const EXAMPLE_DATA = {
        SCAN_ID: '1',
        TASK_KEY: 'NODULE',
        LABELING_TIME: 1337,
        COMMENT: 'Example comment',
        ADDITIONAL_DATA: MOCK_SELECTION.getAdditionalData(),
        LABEL_ID: '36026be2-b475-4f68-9b2f-295afcee2460',
        OWNER_ID: '1',
        STATUS: 'LabelVerificationStatus.NOT_VERIFIED',
        DATASET: 'Example dataset',
        NUM_SLICES: 1337

ngx-socket-io

Socket.IO module for Angular

MIT
Latest version published 3 months ago

Package Health Score

72 / 100
Full package analysis