javascript - Durandal issue with Breeze and Q -
hi i'm new building web pages applications, started hottowel videos john papa , used hottowel vsix template.
when decided update durandal 2.0 faced issue application not proceed activate method in shell module.
after google search's found out problem has due durandal using jquery promises, have tried fix announced in http://durandaljs.com/documentation/q/ not working, can provide me light on issue.
ps: im new js , web in general i'm sorry if question isn't clear enough
in shell.js have:
function activate() { app.title = config.apptitle; return datacontext.primedata() .then(boot) .fail(failedinitialization); } function boot() { logger.log('codecamper backend loaded!', null, system.getmoduleid(shell), true); router.map(config.routes).buildnavigationmodel(); return router.activate(); } function addsession(item) { router.navigateto(item.hash); } function failedinitialization(error) { var msg = 'app initialization failed: ' + error.message; logger.logerror(msg, error, system.getmoduleid(shell), true); }
and in datacontext:
var primedata = function () { var promise = q.all([ getlookups(), getspeakerpartials(null, true)]) .then(applyvalidators) return promise .then(success); function success() { datacontext.lookups = { rooms: getlocal('rooms', 'name', true), tracks: getlocal('tracks', 'name', true), timeslots: getlocal('timeslots', 'start', true), speakers: getlocal('persons', orderby.speaker, true) }; log('primed data', datacontext.lookups); } function applyvalidators() { model.applysessionvalidators(manager.metadatastore); } };
you need pass route router.activate() function activate first route. assuming 2 things -
- your codecamper backend message firing because promise being returned
- you have added jquery deferred q map shown in page referenced.
if above 2 not true please let me know if have indeed done number 2 , application pausing or not loading
Comments
Post a Comment