Wednesday, 15 February 2012

javascript - Steroids and Angular: Preloading Multiple Webviews from data -



javascript - Steroids and Angular: Preloading Multiple Webviews from data -

i'm working steroids generator ng-resource, has generated controller/model/views based on local json data. has index.html , detailed.html

the boilerplate code provides list of cars click on, bringing new webview of car's detailed page. easy enough. problem is, view not preloaded - loads in after click auto in auto list. creates laggy experience.

i've read on preloading webviews - works great if don't have bunch of webviews powered dynamic data. preload detailed webviews based on initial listing of "cars". i've been reading next resources:

preloaded webviews different parts of app

sharing info between webviews

preloading webviews

i don't have lot of raw code provide - boilerplate examples of ng-resource. i'm wondering best technical approach needs. trying native app sense when navigating.

edit: here improve reply appgyver/steroids team

from have described utilize case suggest preload show.html in app 1 time , whenever need show show.html send postmessage view moving show.html should load content id provided.

if have load content remote server, should send 2 postmessages, first 1 including whatever info have on previous page used on show.html page.

i don't know if able explain in understandable way, please inquire more questions if explanation unclear ) turns out pretty easy:

the main problem solution below memory issues creating vast amount of webviews

old answer: for(var =0; var webview = new steroids.views.webview({location:"/views/cars/show.html? id="+id,id:id}); console.log(webview); webview.preload({}, { onsuccess: function() { //steroids.layers.push(webview); console.log('working'); } }); }

then function phone call webview same id:

$scope.open = function(id) { var webview = new steroids.views.webview({location:"/views/cars/show.html?id="+id,id:id}); steroids.layers.push(webview); };

javascript angularjs webview steroids

No comments:

Post a Comment