Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

uncaught (in promise): both the table and dtoptions cannot be empty

export class DatatableslibraryComponent implements OnInit, OnDestroy {

  users$: any[] = [];
  dtOptions: DataTables.Settings = {};
  dtTrigger: Subject<any> = new Subject();

  constructor(private http: HttpClient, private data: DataService) {
  }

  ngOnInit() {
    this.dtOptions = {
      pagingType: 'full_numbers',
      pageLength: 5,
      processing: true
    };
    this.data.getUsers().subscribe(data => {
      this.users$ = data;
      this.dtTrigger.next();
    });
  }

  ngOnDestroy(): void {
    this.dtTrigger.unsubscribe();
  }

}
Comment

PREVIOUS NEXT
Code Example
Javascript :: jshint ignore 
Javascript :: how to get the inner width of a parent div for canvas 
Javascript :: how to play audio in javascript 
Javascript :: count javascript 
Javascript :: duplicate elements of array multiple times 
Javascript :: npm run build npm ERR! Missing script: "build" for firebase 
Javascript :: set localstorage 
Javascript :: app script map fit markers 
Javascript :: react 18 
Javascript :: modulo operator in javascript 
Javascript :: import library react js 
Javascript :: fetch request javascript 
Javascript :: remove special characters in javascript 
Javascript :: remove duplicate value from array 
Javascript :: remove duplicates multidimensional array javascript 
Javascript :: convert json to table in sql server 
Javascript :: how to convert array converted to string back to array javasccript 
Javascript :: jquery copy table to clipboard 
Javascript :: how to import svg in react 
Javascript :: how to open print dialog box on button click 
Javascript :: password page javascript 
Javascript :: how to get sum array in javascript 
Javascript :: javascript count character in string 
Javascript :: javascript split string by multiple characters 
Javascript :: get background image url jquery 
Javascript :: come andare a capo su javascript 
Javascript :: queryselectorall in javascript to get data attribute value 
Javascript :: window.location.href url.action parameters 
Javascript :: finding prime numbers in javascript 
Javascript :: requestanimationframe 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =