0
嗨,我是新來建設網頁應用程序, 我開始與約翰帕帕HotTowel視頻,並最初使用HotTowel VSIX模板。Durandal問題與Breeze和Q
當我決定更新到Durandal 2.0時,我面臨的問題是應用程序不會從shell模塊中的activate方法進行。
後一些谷歌搜索的我發現這個問題必須因與使用jQuery的承諾迪朗達爾,我曾試圖http://durandaljs.com/documentation/Q/ 但它不工作公佈了修復,有人可以給我提供關於這一問題的一些情況。
PS:進出口新的JS和網絡一般,所以我很抱歉,如果這個問題是不是在我shell.js足夠
清楚我有:
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);
}
,並在我的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);
}
};
嗨,我們不再傳遞路線激活功能從我瞭解的事實上,如果只是返回router.activate沒有datacontext.primeData承諾它的作品。 – forcewill
您是否嘗試在查詢中處理失敗情況以查看它是否失敗?在那裏鏈接一個.fail(),並在出現錯誤時提醒 –