angular / angular/components

mat-nav-bar missing example for method updateActiveLinks

Open
#14,032 1 comment 0 reactions 0 assignees View on GitHub
area: docs area: material/tabs P3
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

https://github.com/angular/material2/blob/a6c6a58cc4bccddeb87ad71b33a849527e23c462/src/lib/tabs/tab-nav-bar/tab-nav-bar.ts#L118-L123

The [docs](https://material.angular.io/components/tabs/api#MatTabNav) do not provide any explanation of how to access this method. Tried checking other methods that I have used but nothing works.


{{ link.title }}

Is this this correct?
`@ViewChild( 'tabs' ) tabs: MatTabNav;`
Even tried this:
`@ViewChild( 'MatTabNav' ) tabs: MatTabNav;`

I feel like I am missing something important
`this.whatshouldthisbe.updateActiveLink( '#tabs' )`

As a side note, many other times I feel the source code makes far more sense than the docs do. Do I need to fully understand the source in order to make sense of the docs?

Contributor guide

Open the contributing guide

Research direction

Start with the linked tab-nav-bar.ts source around lines 118-123 and the MatTabNav API documentation. Verify how the reported updateActiveLink/updateActiveLinks method is accessed from the shown template, then update the docs with an explanation and working example; done means newcomers can follow the example without guessing the ViewChild reference.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
documentation, frontend
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.