Can Durandaljs do Areas

自古美人都是妖i 提交于 2019-12-03 08:45:13

yes you can do this.

Since you are using Durandal.router you can use a convention of where to find your ViewModels by overriding the routers autoConvertRouteToModuleId like so:

router.autoConvertRouteToModuleId = function(url, params) {
    return url + '/' + 'params[0]';
};

As for finding the view that binds to your viewmodel then you can like you have above.. change the viewlocator convention.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!