Skip to content

Commit 5176916

Browse files
committed
Add a component with an external template (templateUrl)
1 parent 21ea08d commit 5176916

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

ng-sample/src/renderer-test.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
import {Inject, Component, View, NgIf, NgFor} from 'angular2/angular2';
22

3+
@Component({
4+
selector: 'templated-component',
5+
templateUrl: 'title.html'
6+
})
7+
export class TemplatedComponent {
8+
}
9+
310
@Component({
411
selector: 'renderer-test'
512
})
613
@View({
7-
directives: [NgIf, NgFor],
14+
directives: [NgIf, NgFor, TemplatedComponent],
815
template: `
916
<StackLayout orientation='vertical'>
17+
<templated-component></templated-component>
1018
<Label [class.valid]="isValid" [class.invalid]="!isValid" text='Name' fontSize='20' verticalAlignment='center' padding='20'></Label>
1119
<TextField #name text='John' fontSize='20' padding='20'></TextField>
1220
<Button [text]='buttonText' (tap)='onSave($event, name.text, $el)'></Button>

ng-sample/src/title.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<Label text="Hello, external templates"></Label>

0 commit comments

Comments
 (0)