File tree Expand file tree Collapse file tree 2 files changed +19
-14
lines changed Expand file tree Collapse file tree 2 files changed +19
-14
lines changed Original file line number Diff line number Diff line change @@ -13,21 +13,21 @@ QUnit.module('App Boot', function (hooks) {
13
13
QUnit . test ( 'nested {{component}}' , function ( assert ) {
14
14
this . template ( 'index' , '{{root-component}}' ) ;
15
15
16
- this . template (
17
- 'components/root-component' ,
16
+ this . component (
17
+ 'root-component' ,
18
+ {
19
+ location : 'World' ,
20
+ hasExistence : true ,
21
+ } ,
18
22
"\
19
- <h1>Hello {{#if this.hasExistence}}{{this.location}}{{/if}}</h1>\
20
- <div>{{component 'foo-bar'}}</div>\
21
- "
23
+ <h1>Hello {{#if this.hasExistence}}{{this.location}}{{/if}}</h1>\
24
+ <div>{{component 'foo-bar'}}</div>\
25
+ "
22
26
) ;
23
27
24
- this . component ( 'root-component' , {
25
- location : 'World' ,
26
- hasExistence : true ,
27
- } ) ;
28
-
29
- this . template (
30
- 'components/foo-bar' ,
28
+ this . component (
29
+ 'foo-bar' ,
30
+ undefined ,
31
31
'\
32
32
<p>The files are *inside* the computer?!</p>\
33
33
'
Original file line number Diff line number Diff line change @@ -61,6 +61,8 @@ module.exports = function (hooks) {
61
61
62
62
this . Ember = Ember ;
63
63
this . compile = compile ;
64
+ this . setComponentTemplate = Ember . _setComponentTemplate ;
65
+ this . templateOnlyComponent = Ember . _templateOnlyComponent ;
64
66
65
67
Ember . testing = true ;
66
68
@@ -166,8 +168,11 @@ function registerTemplate(name, template) {
166
168
this . register ( 'template:' + name , this . compile ( template ) ) ;
167
169
}
168
170
169
- function registerComponent ( name , componentProps ) {
170
- let component = this . Ember . Component . extend ( componentProps ) ;
171
+ function registerComponent ( name , componentProps , templateContents ) {
172
+ let component = this . setComponentTemplate (
173
+ this . compile ( templateContents ) ,
174
+ componentProps ? this . Ember . Component . extend ( componentProps ) : this . templateOnlyComponent ( )
175
+ ) ;
171
176
this . register ( 'component:' + name , component ) ;
172
177
}
173
178
You can’t perform that action at this time.
0 commit comments