Skip to content

Commit c589131

Browse files
committed
feat(ng-let): allow static queries (ng8)
1 parent be688ab commit c589131

File tree

1 file changed

+22
-28
lines changed

1 file changed

+22
-28
lines changed
Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import {
2-
Directive,
3-
Input,
4-
OnInit,
5-
TemplateRef,
6-
ViewContainerRef,
2+
Directive,
3+
Input,
4+
TemplateRef,
5+
ViewContainerRef,
76
} from '@angular/core';
87

98
/**
@@ -26,33 +25,28 @@ class NgLetContext {
2625
// tslint:disable-next-line: directive-selector
2726
selector: '[ngLet]',
2827
})
29-
export class UiNgLetDirective implements OnInit {
28+
export class UiNgLetDirective {
3029
private _context = new NgLetContext();
3130

32-
/**
33-
* The context bound to the decorated area.
34-
*
35-
*/
36-
@Input()
31+
/**
32+
* The context bound to the decorated area.
33+
*
34+
*/
35+
@Input()
3736
set ngLet(value: any) {
3837
this._context.$implicit = this._context.ngLet = value;
3938
}
4039

41-
/**
42-
* @ignore
43-
*/
44-
constructor(
45-
private _vcr: ViewContainerRef,
46-
private _templateRef: TemplateRef<NgLetContext>,
47-
) { }
48-
49-
/**
50-
* @ignore
51-
*/
52-
ngOnInit() {
53-
this._vcr.createEmbeddedView(
54-
this._templateRef,
55-
this._context,
56-
);
57-
}
40+
/**
41+
* @ignore
42+
*/
43+
constructor(
44+
private _vcr: ViewContainerRef,
45+
private _templateRef: TemplateRef<NgLetContext>,
46+
) {
47+
this._vcr.createEmbeddedView(
48+
this._templateRef,
49+
this._context,
50+
);
51+
}
5852
}

0 commit comments

Comments
 (0)