1
- import {
2
- Component ,
3
- Directive ,
4
- Input ,
5
- Output ,
6
- EventEmitter ,
7
- OnInit ,
8
- OnDestroy ,
9
- AfterViewInit ,
10
- ElementRef ,
11
- Injectable ,
12
- Optional ,
13
- Renderer2 ,
14
- ViewContainerRef , } from '@angular/core' ;
1
+ import { Component , Directive , Input , Output , EventEmitter , OnInit , OnDestroy , AfterViewInit , ElementRef , Injectable , Optional } from '@angular/core' ;
15
2
16
3
import { Observable } from 'rxjs/Observable' ;
17
4
import { ScrollDispatcher } from '../core/overlay/scroll/scroll-dispatcher' ;
@@ -20,44 +7,21 @@ import {Subject} from 'rxjs/Subject';
20
7
21
8
22
9
@Directive ( {
23
- selector : '[md-sticky-viewport], [cdkStickyViewport], [ cdkStickyRegion]' ,
10
+ selector : '[cdkStickyRegion]' ,
24
11
} )
25
-
26
-
27
- @Injectable ( )
28
- export class StickyParentDirective implements OnInit , OnDestroy , AfterViewInit {
29
-
30
- // The parent element, which with the 'md-sticky-viewport' tag
31
- private pelem : any ;
32
-
33
- constructor ( private element : ElementRef ) {
34
- this . pelem = element . nativeElement ;
35
- }
36
-
37
- ngOnInit ( ) : void {
38
- this . pelem . classList . add ( 'sticky-parent' ) ;
39
- }
40
-
41
- ngAfterViewInit ( ) : void {
42
-
43
- }
44
-
45
- ngOnDestroy ( ) : void {
46
- this . pelem . classList . remove ( 'sticky-parent' ) ;
47
- }
12
+ export class StickyParentDirective {
13
+ constructor ( private element : ElementRef ) { }
48
14
49
15
getElementRef ( ) : ElementRef {
50
16
return this . element ;
51
17
}
52
18
}
53
19
54
20
55
-
56
21
@Directive ( {
57
- selector : '[md-sticky], [cdkSticky], [ cdkStickyHeader]' ,
22
+ selector : '[cdkStickyHeader]' ,
58
23
} )
59
24
60
-
61
25
@Injectable ( )
62
26
export class StickyHeaderDirective implements OnInit , OnDestroy , AfterViewInit {
63
27
0 commit comments