Skip to content

Instantly share code, notes, and snippets.

@evoratec
Last active August 29, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evoratec/10043417 to your computer and use it in GitHub Desktop.
Save evoratec/10043417 to your computer and use it in GitHub Desktop.
// 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