diff --git a/demo/package.json b/demo/package.json index 053279d0..185de568 100644 --- a/demo/package.json +++ b/demo/package.json @@ -1,6 +1,6 @@ { "name": "angular-datatables-demo", - "version": "16.0.0", + "version": "17.0.1", "license": "MIT", "scripts": { "ng": "ng", diff --git a/demo/src/app/basic/with-ajax-callback/with-ajax-callback.component.html b/demo/src/app/basic/with-ajax-callback/with-ajax-callback.component.html index 8ad7b16f..04d7e560 100644 --- a/demo/src/app/basic/with-ajax-callback/with-ajax-callback.component.html +++ b/demo/src/app/basic/with-ajax-callback/with-ajax-callback.component.html @@ -1,5 +1,7 @@ - + + No preview as we do not have a server that can serve the queries. + diff --git a/demo/src/app/basic/with-ajax-callback/with-ajax-callback.component.spec.ts b/demo/src/app/basic/with-ajax-callback/with-ajax-callback.component.spec.ts index 19cc404a..d2705b88 100644 --- a/demo/src/app/basic/with-ajax-callback/with-ajax-callback.component.spec.ts +++ b/demo/src/app/basic/with-ajax-callback/with-ajax-callback.component.spec.ts @@ -1,7 +1,6 @@ import { HttpClientModule } from '@angular/common/http'; import { SecurityContext, NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { By } from '@angular/platform-browser'; import { RouterTestingModule } from '@angular/router/testing'; import { DataTableDirective, DataTablesModule } from 'angular-datatables'; import { AppRoutingModule } from 'app/app.routing'; @@ -50,15 +49,4 @@ describe('WithAjaxCallbackComponent', () => { expect(app.pageTitle).toBe('AJAX with callback'); })); - it('should have table populated via AJAX', async () => { - const app = fixture.debugElement.componentInstance as WithAjaxCallbackComponent; - await fixture.whenStable(); - expect(app.dtOptions.columns).toBeDefined(); - const query = fixture.debugElement.query(By.directive(DataTableDirective)); - const dir = query.injector.get(DataTableDirective); - expect(dir).toBeTruthy(); - const instance = await dir.dtInstance; - fixture.detectChanges(); - expect(instance.rows().length).toBeGreaterThan(0); - }); }); diff --git a/demo/src/app/basic/with-ajax-callback/with-ajax-callback.component.ts b/demo/src/app/basic/with-ajax-callback/with-ajax-callback.component.ts index 30bc4431..47120821 100644 --- a/demo/src/app/basic/with-ajax-callback/with-ajax-callback.component.ts +++ b/demo/src/app/basic/with-ajax-callback/with-ajax-callback.component.ts @@ -1,6 +1,5 @@ import { HttpClient } from '@angular/common/http'; import { Component, OnInit } from '@angular/core'; -import { DataTablesResponse } from 'app/datatables-response.model'; @Component({ selector: 'app-with-ajax-callback', @@ -22,19 +21,6 @@ export class WithAjaxCallbackComponent implements OnInit { ngOnInit(): void { const that = this; this.dtOptions = { - ajax: (dataTablesParameters: any, callback) => { - that.http - .post( - 'https://xtlncifojk.eu07.qoddiapp.com/', - dataTablesParameters, {} - ).subscribe(resp => { - callback({ - recordsTotal: resp.recordsTotal, - recordsFiltered: resp.recordsFiltered, - data: resp.data - }); - }); - }, columns: [{ title: 'ID', data: 'id'
+ No preview as we do not have a server that can serve the queries. +
No preview as we do not have a server that can serve the queries.