1
1
// make sure you import mocha-config before @angular/core
2
- import { assert } from ' ./test-config' ;
3
- import { Component , ComponentRef , Directive , TemplateRef , ViewContainerRef } from ' @angular/core' ;
4
- import { View } from ' ui/core/view' ;
5
- import { Label } from ' ui/label' ;
6
- import { nTestBedAfterEach , nTestBedBeforeEach , nTestBedRender } from ' nativescript-angular/testing' ;
2
+ import { assert } from " ./test-config" ;
3
+ import { Component , ComponentRef , Directive , TemplateRef , ViewContainerRef } from " @angular/core" ;
4
+ import { View } from " ui/core/view" ;
5
+ import { Label } from " ui/label" ;
6
+ import { nTestBedAfterEach , nTestBedBeforeEach , nTestBedRender } from " nativescript-angular/testing" ;
7
7
// >> third-party-simple-view-registration
8
- import { registerElement } from ' nativescript-angular/element-registry' ;
8
+ import { registerElement } from " nativescript-angular/element-registry" ;
9
9
registerElement ( "third-party-view" , ( ) => require ( "./third-party-view" ) . SimpleTag ) ;
10
10
// << third-party-simple-view-registration
11
11
@@ -48,18 +48,18 @@ export class DocumentFormComponent {
48
48
} )
49
49
export class DocumentTitleDirective {
50
50
public static titleLabel : Label ;
51
-
52
51
constructor (
53
52
private ownerForm : DocumentFormComponent ,
54
53
private viewContainer : ViewContainerRef ,
55
- private template : TemplateRef < any > ) {
54
+ private template : TemplateRef < any >
55
+ ) {
56
56
}
57
57
58
58
ngOnInit ( ) {
59
59
const viewRef = this . viewContainer . createEmbeddedView ( this . template ) ;
60
60
// filter out whitespace nodes
61
61
const titleViews = viewRef . rootNodes . filter ( ( node ) =>
62
- node && node . nodeName !== "#text" ) ;
62
+ node && node . nodeName !== "#text" ) ;
63
63
64
64
if ( titleViews . length > 0 ) {
65
65
const titleView = titleViews [ 0 ] ;
@@ -73,9 +73,9 @@ export class DocumentTitleDirective {
73
73
@Component ( {
74
74
selector : "document-form-container" ,
75
75
template : `
76
- <document-form src="document1.pdf">
77
- <Label *documentTitle text="Document1"></Label>
78
- </document-form>
76
+ <document-form src="document1.pdf">
77
+ <Label *documentTitle text="Document1"></Label>
78
+ </document-form>
79
79
`
80
80
} )
81
81
export class DocumentFormContainer {
0 commit comments