-
Notifications
You must be signed in to change notification settings - Fork 85
Active mdc-tab #349
Comments
Hey @ESKI Could you review my examples below and see if they work for you? I'll hold off on code change until I hear back. <mdc-tab routerLink="/sales/create" routerLinkActive #rla="routerLinkActive"
[active]="rla.isActive">
Saisie vente
</mdc-tab> Also, here's an example with an *ngFor <mdc-tab-bar>
<mdc-tab *ngFor="let tabLink of tabLinks" [routerLink]="[{outlets: {taboutlet: tabLink.link}}]"
routerLinkActive #rla="routerLinkActive" [active]="rla.isActive">{{tabLink.label}}</mdc-tab>
</mdc-tab-bar> |
It's the same thing as before. |
Kk. I'm testing some changes that can handle tab routing with url's. |
- [x] Add `disabled` tab - [x] Fix `[active]` property changes not propagating #349 - [x] Fix `mdc-tab-bar-scroller__indicator` misplaced issue #281 - [x] Remove `mdc-tab-bar-scroll-button` directive #### mdc-tab * Add `disabled: boolean` property to `mdc-tab` * Refactor `active` property * Add `changeDetection: ChangeDetectionStrategy.OnPush` * Add `preserveWhitespaces: false` * Add `getComputedWidth(): number`; return the computed width for tab. * Add `getComputedLeft(): number`; return the computed left offset for tab. * Add `isActive()` return true if tab is active. * Add `setActive(boolean)`; set tab active property to value passed. * Add `getPreventDefaultOnClick(): boolean`; return true if the tab prevents the default click action. * Add `setPreventDefaultOnClick(boolean)`; sets tabs `preventDefaultOnClick` property to the value passed. * Add `measureSelf()`; sets computedWidth and computedLeft for a tab. #### mdc-tab-bar * Add `getComputedWidth(): number` * Add `layout(): void` * Add `changeDetection: ChangeDetectionStrategy.OnPush` * Add `preserveWhitespaces: false` * Add `getActiveTabIndex(): number` * Add `switchToTabAtIndex(index: number, shouldNotify: boolean = true)` * Add `MdcTabBarIndicator` directive * Add `setPreventDefaultOnClickForTabAtIndex(index: number, preventDefaultOnClick: boolean)` * Add `isDefaultPreventedOnClickForTabAtIndex(index: number): boolean` #### mdc-tab-bar-scroller * Add `layout()` * Add `changeDetection: ChangeDetectionStrategy.OnPush` * Add `preserveWhitespaces: false` * Add `scrollBack(event?: Event)` * Add `scrollForward(event?: Event)` * Remove `mdc-tab-bar-scroll-button` directive BREAKING CHANGE: Removed `mdc-tab-bar-scroll-button` directive. Use `mdc-icon` instead. Please update your code accordingly. Example: ```html <mdc-tab-bar-scroll-back> <mdc-icon>navigate_before</mdc-icon> </mdc-tab-bar-scroll-back> ``` Closes #349 Closes #147 Closes #281
hi, i am on Angular 7 Error stack :- core.js:15714 ERROR Error: Uncaught (in promise): Error: Template parse errors:
|
|
Hello @MAKITSUNE I used the
Capture the
It's a little tricky way but it works, I hope @trimox can restore the property soon. |
Hi,
I'm actually working with tabs and notice that you can't set active to mdc-tab based on route url.
Here a example :
With this approach, the mdc-tab get the .mdc-tab--active class but the tab line stay in the initial position.
The text was updated successfully, but these errors were encountered: