Skip to content

Commit 4af84fe

Browse files
committed
refactor(compiler): swap template and templateUrl priority in compilation
1 parent 836bc0a commit 4af84fe

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/helpers/compiler.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,12 @@ function bsCompilerService($q, $http, $injector, $compile, $controller, $templat
9999
// eg locals: { three: 3 }, will inject three into the controller
100100
angular.extend(resolve, locals);
101101

102-
if (templateUrl) {
102+
if (template) {
103+
resolve.$template = $q.when(template);
104+
} else if (templateUrl) {
103105
resolve.$template = fetchTemplate(templateUrl);
104106
} else {
105-
resolve.$template = $q.when(template);
107+
throw new Error('Missing `template` / `templateUrl` option.');
106108
}
107109

108110
if (options.contentTemplate) {

0 commit comments

Comments
 (0)