title: Is it safe to use Angular API methods with underscore prefix?
body: <p>Angular material <a href="https://github.com/angular/components/blob/master/src/material/paginator/paginator.ts#L230" rel="nofollow noreferrer">paginator</a> has a method starting with <code>_</code>.</p>
  
  <pre><code>_changePageSize(pageSize: number) {
      // Current page needs to be updated to reflect the new page size. Navigate to the page
      // containing the previous page's first item.
      const startIndex = this.pageIndex * this.pageSize;
      const previousPageIndex = this.pageIndex;
  
      this.pageIndex = Math.floor(startIndex / pageSize) || 0;
      this.pageSize = pageSize;
      this._emitPageEvent(previousPageIndex);
    }
  </code></pre>
  
  <p>This method is <strong>not</strong> listed in the <a href="https://material.angular.io/components/paginator/api#MatPaginator" rel="nofollow noreferrer">Paginator API</a> documentation. However it's refered in answers like <a href="https://stackoverflow.com/a/47243927/1007447">this</a>.</p>
  
  <p>In the same paginator component, a method defined as private and not available in IDE. </p>
  
  <pre><code>private _updateDisplayedPageSizeOptions() {
      if (!this._initialized) { return; }
  
      // If no page size is provided, use the first page size option or the default page size.
      if (!this.pageSize) {
        this._pageSize = this.pageSizeOptions.length != 0 ?
            this.pageSizeOptions[0] :
            DEFAULT_PAGE_SIZE;
      }
  </code></pre>
  
  <p>In AOT it gives error after successful compilation.</p>
  
  <blockquote>
    <p>i ｢wdm｣: Compiled successfully.</p>
  
  <pre><code>ERROR in src/app/models/models.component.ts(153,22):
  </code></pre>
    
    <p>error TS2341: Property '_updateDisplayedPageSizeOptions' is private
    and only accessible within class 'MatPaginator'.</p>
  </blockquote>
  
  <p>I understand <code>_</code> by conventions refers private and no direct private method concept in Javascript. Just need more info on:</p>
  
  <ul>
  <li>Is that an internal method that should not be relied on?</li>
  <li>In angular (or in angular-material) what is the difference between a method that starts with <code>_</code> and regular method?</li>
  <li>If it's changePageSize is not a private method why <code>_</code> suffix? If it's private method, why it's not marked as private? Is this inconsistency or something I'm missing here?</li>
  </ul>