File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -205,7 +205,7 @@ export class Compiler {
205
205
var templateAbsUrl = null ;
206
206
if ( isPresent ( view . templateUrl ) ) {
207
207
templateAbsUrl = this . _urlResolver . resolve ( componentUrl , view . templateUrl ) ;
208
- } else {
208
+ } else if ( isPresent ( view . template ) ) {
209
209
// Note: If we have an inline template, we also need to send
210
210
// the url for the component to the renderer so that it
211
211
// is able to resolve urls in stylesheets.
Original file line number Diff line number Diff line change @@ -105,6 +105,14 @@ export function main() {
105
105
} ) ;
106
106
} ) ) ;
107
107
108
+ it ( 'should not fill absUrl given no inline template or template url' , inject ( [ AsyncTestCompleter ] , ( async ) => {
109
+ cmpUrlMapper . setComponentUrl ( MainComponent , '/mainComponent' ) ;
110
+ captureTemplate ( new View ( { template : null , templateUrl : null } ) ) . then ( ( renderTpl ) => {
111
+ expect ( renderTpl . absUrl ) . toBe ( null )
112
+ async . done ( ) ;
113
+ } ) ;
114
+ } ) ) ;
115
+
108
116
it ( 'should fill absUrl given url template' , inject ( [ AsyncTestCompleter ] , ( async ) => {
109
117
cmpUrlMapper . setComponentUrl ( MainComponent , '/mainComponent' ) ;
110
118
captureTemplate ( new View ( { templateUrl : '/someTemplate' } ) ) . then ( ( renderTpl ) => {
You can’t perform that action at this time.
0 commit comments