Skip to content

Commit cb9b81d

Browse files
committed
fix(templateCache): make sure $state is passed config options before checking what they are
1 parent f5e986c commit cb9b81d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: js/angular/service/templateCache.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ function($stateProvider, $ionicConfigProvider) {
101101
var stateProviderState = $stateProvider.state;
102102
$stateProvider.state = function(stateName, definition) {
103103
// don't even bother if it's disabled. note, another config may run after this, so it's not a catch-all
104-
if($ionicConfigProvider.prefetchTemplates() !== false){
104+
if(typeof definition === 'object' && $ionicConfigProvider.prefetchTemplates() !== false){
105105
var enabled = definition.prefetchTemplate !== false;
106106
if(enabled && isString(definition.templateUrl))templatesToCache.push(definition.templateUrl);
107107
if(angular.isObject(definition.views)){

0 commit comments

Comments
 (0)