File tree Expand file tree Collapse file tree 5 files changed +35
-8
lines changed
classic-to-flat/example-1
classic-to-nested/example-1 Expand file tree Collapse file tree 5 files changed +35
-8
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,15 @@ module.exports = class Migrator {
75
75
// Extract '/app/templates/components/nested1/nested-component.hbs'
76
76
let filePathFromApp = templateFilePath . slice ( this . projectRoot . length ) ;
77
77
78
+ /*
79
+ When Ember sees `{{partial "foo"}}`, it will look for the template in
80
+ two locations:
81
+
82
+ - `app/templates/foo.hbs`
83
+ - `app/templates/-foo.hbs`
84
+
85
+ If `filePathFromApp` matches the latter pattern, we remove the hyphen.
86
+ */
78
87
if ( / \/ \- [ \w \- ] + \. h b s / . test ( filePathFromApp ) ) {
79
88
filePathFromApp = filePathFromApp . replace ( '/-' , '/' ) ;
80
89
}
Original file line number Diff line number Diff line change @@ -66,10 +66,15 @@ module.exports = {
66
66
67
67
// A partial template
68
68
'partials' : {
69
- 'partials-template.hbs' : '{{!-- partials-template.hbs --}}' ,
69
+ 'partial-one-template.hbs' : '{{!-- partial-one-template.hbs --}}' ,
70
+ 'partial-two-template.hbs' : '{{!-- partial-two-template.hbs --}}' ,
71
+ '-partial-three-template.hbs' : '{{!-- partial-three-template.hbs --}}' ,
72
+
70
73
'with-partial.hbs' : [
71
74
'{{!-- with-partial.hbs --}}' ,
72
- '{{partial "components/partials/partials-template"}}'
75
+ '{{partial "components/partials/partial-one-template"}}' ,
76
+ '{{partial "components/partials/partial-two-template"}}' ,
77
+ '{{partial "components/partials/partial-three-template"}}'
73
78
] . join ( '\n' )
74
79
}
75
80
}
Original file line number Diff line number Diff line change @@ -44,7 +44,9 @@ module.exports = {
44
44
'partials' : {
45
45
'with-partial.hbs' : [
46
46
'{{!-- with-partial.hbs --}}' ,
47
- '{{partial "components/partials/partials-template"}}'
47
+ '{{partial "components/partials/partial-one-template"}}' ,
48
+ '{{partial "components/partials/partial-two-template"}}' ,
49
+ '{{partial "components/partials/partial-three-template"}}'
48
50
] . join ( '\n' )
49
51
}
50
52
} ,
@@ -60,7 +62,9 @@ module.exports = {
60
62
61
63
// A partial template
62
64
'partials' : {
63
- 'partials-template.hbs' : '{{!-- partials-template.hbs --}}' ,
65
+ 'partial-one-template.hbs' : '{{!-- partial-one-template.hbs --}}' ,
66
+ 'partial-two-template.hbs' : '{{!-- partial-two-template.hbs --}}' ,
67
+ '-partial-three-template.hbs' : '{{!-- partial-three-template.hbs --}}'
64
68
}
65
69
}
66
70
}
Original file line number Diff line number Diff line change @@ -66,10 +66,15 @@ module.exports = {
66
66
67
67
// A partial template
68
68
'partials' : {
69
- 'partials-template.hbs' : '{{!-- partials-template.hbs --}}' ,
69
+ 'partial-one-template.hbs' : '{{!-- partial-one-template.hbs --}}' ,
70
+ 'partial-two-template.hbs' : '{{!-- partial-two-template.hbs --}}' ,
71
+ '-partial-three-template.hbs' : '{{!-- partial-three-template.hbs --}}' ,
72
+
70
73
'with-partial.hbs' : [
71
74
'{{!-- with-partial.hbs --}}' ,
72
- '{{partial "components/partials/partials-template"}}'
75
+ '{{partial "components/partials/partial-one-template"}}' ,
76
+ '{{partial "components/partials/partial-two-template"}}' ,
77
+ '{{partial "components/partials/partial-three-template"}}'
73
78
] . join ( '\n' )
74
79
}
75
80
}
Original file line number Diff line number Diff line change @@ -55,7 +55,9 @@ module.exports = {
55
55
'with-partial' : {
56
56
'index.hbs' : [
57
57
'{{!-- with-partial.hbs --}}' ,
58
- '{{partial "components/partials/partials-template"}}'
58
+ '{{partial "components/partials/partial-one-template"}}' ,
59
+ '{{partial "components/partials/partial-two-template"}}' ,
60
+ '{{partial "components/partials/partial-three-template"}}'
59
61
] . join ( '\n' )
60
62
}
61
63
}
@@ -72,7 +74,9 @@ module.exports = {
72
74
73
75
// A partial template
74
76
'partials' : {
75
- 'partials-template.hbs' : '{{!-- partials-template.hbs --}}' ,
77
+ 'partial-one-template.hbs' : '{{!-- partial-one-template.hbs --}}' ,
78
+ 'partial-two-template.hbs' : '{{!-- partial-two-template.hbs --}}' ,
79
+ '-partial-three-template.hbs' : '{{!-- partial-three-template.hbs --}}'
76
80
}
77
81
}
78
82
}
You can’t perform that action at this time.
0 commit comments