File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
projects/ngfe/src/lib/core Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 1
1
import {
2
2
ChangeDetectorRef ,
3
- Directive ,
3
+ Directive , EventEmitter ,
4
4
HostBinding ,
5
5
Input ,
6
6
NgZone ,
7
7
OnChanges ,
8
- OnDestroy ,
8
+ OnDestroy , Output ,
9
9
SimpleChanges ,
10
10
} from '@angular/core' ;
11
11
import { ReplaySubject , Subject , Subscription , take } from 'rxjs' ;
@@ -28,14 +28,18 @@ export class FeForm implements OnChanges, OnDestroy {
28
28
private _modelValueChange$ = new Subject < undefined > ( ) ;
29
29
readonly change$ = this . _modelValueChange$ . pipe (
30
30
debounceTime ( 0 ) ,
31
+ map ( ( ) => undefined ) ,
31
32
) ;
33
+ @Output ( ) modelValueChange = new EventEmitter < undefined > ( ) ;
32
34
33
35
private _validityCheck$ = new ReplaySubject < undefined > ( 1 ) ;
34
36
readonly validity$ = this . _validityCheck$ . pipe (
35
37
debounceTime ( 0 ) ,
36
38
map ( ( ) => this . validity ) ,
37
39
distinctUntilChanged ( ) ,
38
40
) ;
41
+ @Output ( ) validityChange = new EventEmitter < FeValidity > ( ) ;
42
+
39
43
readonly valid$ = this . _validityCheck$ . pipe (
40
44
debounceTime ( 0 ) ,
41
45
map ( ( ) => this . valid ) ,
@@ -59,6 +63,8 @@ export class FeForm implements OnChanges, OnDestroy {
59
63
this . _validityCheck$ . subscribe ( ( ) => {
60
64
this . cdr . markForCheck ( ) ;
61
65
} ) ;
66
+ this . change$ . subscribe ( this . modelValueChange ) ;
67
+ this . validity$ . subscribe ( this . validityChange ) ;
62
68
}
63
69
64
70
ngOnChanges ( changes : SimpleChanges ) {
You can’t perform that action at this time.
0 commit comments