mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(templateCache): make sure $state is passed config options before checking what they are
This commit is contained in:
2
js/angular/service/templateCache.js
vendored
2
js/angular/service/templateCache.js
vendored
@@ -101,7 +101,7 @@ function($stateProvider, $ionicConfigProvider) {
|
||||
var stateProviderState = $stateProvider.state;
|
||||
$stateProvider.state = function(stateName, definition) {
|
||||
// don't even bother if it's disabled. note, another config may run after this, so it's not a catch-all
|
||||
if($ionicConfigProvider.prefetchTemplates() !== false){
|
||||
if(typeof definition === 'object' && $ionicConfigProvider.prefetchTemplates() !== false){
|
||||
var enabled = definition.prefetchTemplate !== false;
|
||||
if(enabled && isString(definition.templateUrl))templatesToCache.push(definition.templateUrl);
|
||||
if(angular.isObject(definition.views)){
|
||||
|
||||
Reference in New Issue
Block a user