title: ERROR ObjectUnsubscribedErrorImpl in using angular-datatable using angular 7
body: <p>i am trying to display Datatable in an model window. 
  First time i can able to view the screen as expected. After closing the model window, Now i am trying to view the result in model window but from the second time the Datatable doesn't shows the search box, pagination.</p>
  
  <p>can some one help me to fix this issue.</p>
  
  <p>Expected: <img src="https://i.stack.imgur.com/UKUVA.jpg" alt="click to view"><br></p>
  
  <p>second: <img src="https://i.stack.imgur.com/w0KAw.jpg" alt="click to view"><br></p>
  
  <p>Error: <img src="https://i.stack.imgur.com/7xLMU.jpg" alt="Click to View Error"></p>
  
  <p><strong>my.component.ts</strong></p>
  
  <pre><code>    @ViewChild(DataTableDirective)
      dtElement: DataTableDirective;
  
      dtOptions: DataTables.Settings = {};
  
      // We use this trigger because fetching the list of persons can be quite long,
      // thus we ensure the data is fetched before rendering
      dtTrigger: Subject&lt;any&gt; = new Subject();
  
      ngOnInit() {
      this.service.getQueryResult(this.saveIteratorParams).subscribe( data =&gt; {
            if (data.success !== false) {
              this.queryViewResultL = data.payload;
  
              this.tableDataList = data.payload.molResults;
  
              if (this.tableDataList !== null || this.tableDataList !== undefined) {
                this.theadData = Object.keys(this.tableDataList[0]);
  
                // Calling the DT trigger to manually render the table
                this.dtOptions = {
                  pagingType: 'full_numbers',
                  pageLength: 10
                };
  
                this.dtTrigger.next();
              }
      }
  
      ngAfterViewInit(): void {
          this.dtTrigger.next();
          // console.log('ngAfterViewInit');
        }
  
        rerender(): void {
          this.dtElement.dtInstance.then((dtInstance: DataTables.Api) =&gt; {
            // Destroy the table first
            dtInstance.destroy();
            // Call the dtTrigger to rerender again
            this.dtTrigger.next();
            // if (this.dtTrigger.observers) { this.dtTrigger.next(); }
          });
        }
  
        ngOnDestroy(): void {
          // Do not forget to unsubscribe the event
          this.dtTrigger.unsubscribe();
          console.log('this.dtTrigger.unsubscribe()', this.dtTrigger);
  
        }
  </code></pre>