title: How to select NgbTabset tab as active on load?
body: <p>The "Select an active tab by id" example at <a href="https://ng-bootstrap.github.io/#/components/tabs" rel="noreferrer">https://ng-bootstrap.github.io/#/components/tabs</a> shows how to use a DOM button to programmatically select an Angular Bootstrap tab to be active.  But how do you set a tab to be active from within the TypeScript code - for example by referencing some persistent state of what tab was most recently open on this view using a service that stored the state?</p>
  
  <p>The activeId documentation on that page explains how to hard-code a tab to be active, but I need to set the tab choice programmatically.  I can set the tab using [activeId] = getActiveId() (where getActiveId() accesses a service in which I can store the tab value), but that gets into all sorts of issues with when the activeId is set, which is presumably why the documentation says "Use the "select" method to switch a tab programmatically".</p>
  
  <p>Following this direction I tried using select on the ngb-tabset and using the html onload event to solve this in the DOM, but was unclear  where to place onload and I couldn't get this to work.</p>
  
  <p>I tried using ngOnInit in the TypeScript to set the DOM state but couldn't figure out how to refer to the ngb-tabset. </p>
  
  <p>What is a good way to coordinate between the TypeScript and the DOM to select NgbTabset tab as active on load?     </p>