File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
libs/cdk/template/src/lib/rx-if-list Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ export class RxIfListDirective {
52
52
*/
53
53
@Input ( )
54
54
set rxIfList ( value : ArrayLike < unknown > | null | undefined ) {
55
- this . _context . $implicit = this . _context . rxIfList = ( ( value ?. length ?? [ ] ) > 0 ) ;
55
+ this . _context . $implicit = this . _context . rxIfList = value ;
56
56
this . _updateView ( ) ;
57
57
}
58
58
@@ -79,7 +79,7 @@ export class RxIfListDirective {
79
79
}
80
80
81
81
private _updateView ( ) {
82
- if ( this . _context . $implicit ) {
82
+ if ( this . _context . $implicit && ( ( ( this . _context . $implicit as ArrayLike < any > ) ?. length ?? [ ] ) > 0 ) ) {
83
83
if ( ! this . _thenViewRef ) {
84
84
this . _viewContainer . clear ( ) ;
85
85
this . _elseViewRef = null ;
@@ -88,7 +88,7 @@ export class RxIfListDirective {
88
88
this . _viewContainer . createEmbeddedView ( this . _thenTemplateRef , this . _context ) ;
89
89
}
90
90
}
91
- } else {
91
+ } else {
92
92
if ( ! this . _elseViewRef ) {
93
93
this . _viewContainer . clear ( ) ;
94
94
this . _thenViewRef = null ;
@@ -107,8 +107,8 @@ export class RxIfListDirective {
107
107
* @publicApi
108
108
*/
109
109
export class RxIfListContext {
110
- $implicit = false ;
111
- rxIfList = false ;
110
+ $implicit : ArrayLike < any > | null | undefined = null ;
111
+ rxIfList : ArrayLike < any > | null | undefined = null ;
112
112
}
113
113
114
114
function assertTemplate ( property : string , templateRef : TemplateRef < any > | null ) : void {
You can’t perform that action at this time.
0 commit comments