File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import {
1919 effect ,
2020 inject ,
2121 input ,
22+ linkedSignal ,
2223 model ,
2324 signal ,
2425} from '@angular/core' ;
@@ -111,7 +112,13 @@ export class TabList implements OnInit, OnDestroy {
111112 readonly selectedTab = model < string | undefined > ( ) ;
112113
113114 /** The current selected Tab pattern, passed to the List pattern. */
114- private readonly _selectedTabPattern : WritableSignal < TabPattern | undefined > = signal ( undefined ) ;
115+ private readonly _selectedTabPattern : WritableSignal < TabPattern | undefined > = linkedSignal (
116+ ( ) => {
117+ const tab = this . findTab ( this . selectedTab ( ) ) ;
118+
119+ return tab ?. _pattern ;
120+ } ,
121+ ) ;
115122
116123 /** Whether the tablist is disabled. */
117124 readonly disabled = input ( false , { transform : booleanAttribute } ) ;
@@ -126,11 +133,11 @@ export class TabList implements OnInit, OnDestroy {
126133 } ) ;
127134
128135 constructor ( ) {
129- effect ( ( ) => {
136+ /* effect(() => {
130137 const tab = this.findTab(this.selectedTab());
131138
132139 this._selectedTabPattern.set(tab?._pattern);
133- } ) ;
140+ });*/
134141
135142 effect ( ( ) => {
136143 const pattern = this . _selectedTabPattern ( ) ;
You can’t perform that action at this time.
0 commit comments