Last active
August 29, 2015 13:58
-
-
Save evoratec/10043417 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// linea 22 | |
directives.service('Navigator', function(ONSEN_CONSTANTS, $http, $compile, $parse, NavigatorStack, requestAnimationFrame,$templateCache) { | |
// Linea 567 | |
if ($templateCache.get(page) != undefined) { | |
var div = document.createElement('div'); | |
div.innerHTML = $templateCache.get(page); | |
var pageContent = angular.element(div.cloneNode(true)); | |
var pageEl = this.generatePageEl(pageContent, options); | |
var pageScope = this.createPageScope(); | |
var compiledPage = this.compilePageEl(pageEl, pageScope); | |
this._pushPageDOM(page, div, compiledPage, pageScope, options); | |
} else { | |
$http({ | |
url: page, | |
method: 'GET' | |
}).error(function(e) { | |
that.onTransitionEnded(); | |
console.error(e); | |
}).success(function(data, status, headers, config) { | |
var div = document.createElement('div'); | |
div.innerHTML = data; | |
$templateCache.put(page,data); | |
var pageContent = angular.element(div.cloneNode(true)); | |
var pageEl = this.generatePageEl(pageContent, options); | |
var pageScope = this.createPageScope(); | |
var compiledPage = this.compilePageEl(pageEl, pageScope); | |
this._pushPageDOM(page, div, compiledPage, pageScope, options); | |
}.bind(this)).error(function(data, status, headers, config) { | |
console.error('error', data, status); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment