Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0ce6abc

Browse files
committed
fix(template): drop @angular/cdk dep for rxIf
1 parent 7c5b994 commit 0ce6abc

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

libs/template/experimental/if/src/lib/if.directive.ts

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,31 @@ import {
88
OnInit,
99
SimpleChanges,
1010
TemplateRef,
11-
ViewContainerRef,
11+
ViewContainerRef
1212
} from '@angular/core';
13+
import { coerceAllFactory, coerceObservable } from '@rx-angular/cdk/coercing';
14+
import {
15+
createTemplateNotifier,
16+
RxNotificationKind
17+
} from '@rx-angular/cdk/notifications';
18+
import { RxStrategyProvider } from '@rx-angular/cdk/render-strategies';
19+
import {
20+
createTemplateManager,
21+
RxTemplateManager
22+
} from '@rx-angular/cdk/template';
1323
import {
1424
NextObserver,
1525
Observable,
1626
ReplaySubject,
1727
Subject,
18-
Subscription,
28+
Subscription
1929
} from 'rxjs';
2030
import { mergeAll } from 'rxjs/operators';
2131
import {
2232
RxIfTemplateNames,
2333
rxIfTemplateNames,
24-
RxIfViewContext,
34+
RxIfViewContext
2535
} from './model/index';
26-
import { coerceBooleanProperty } from '@angular/cdk/coercion';
27-
import {
28-
createTemplateManager,
29-
RxTemplateManager,
30-
} from '@rx-angular/cdk/template';
31-
import { RxStrategyProvider } from '@rx-angular/cdk/render-strategies';
32-
import { coerceAllFactory } from '@rx-angular/cdk/coercing';
33-
import {
34-
createTemplateNotifier,
35-
RxNotificationKind,
36-
} from '@rx-angular/cdk/notifications';
37-
import { coerceObservable } from '@rx-angular/cdk/coercing';
3836

3937
@Directive({
4038
selector: '[rxIf]',
@@ -200,3 +198,10 @@ function updateViewContext<T>(
200198
view.context[k] = context[k];
201199
});
202200
}
201+
202+
/**
203+
* Coerces a data-bound value (typically a string) to a boolean.
204+
*/
205+
function coerceBooleanProperty(value: any): boolean {
206+
return value != null && `${value}` !== 'false';
207+
}

0 commit comments

Comments
 (0)