Note that there are some explanatory texts on larger screens.

plurals
  1. PODurandal and MVC4 Areas for multiple SPAs
    primarykey
    data
    text
    <p>I have a internet application mvc4 with areas, for my organization each area represent a SPA and through "Manage NuGet Package" I installed "Durandal 1.2.0", "Durandal Transitions 1.2.0" and "Durandal Router 1.2.0". I organized the folders and quit the "views" and "viewmodels" from folder "App" of Durandal and put the new views in folder "VIews" of mvc4 area for example:</p> <p>Areas-->NewArea-->Views-->ControllerFolder-->views-->shell.html</p> <p>Then I put the '"viewmodels" in "Script" folder for example:</p> <p>Scripts-->NewArea-->ControllerFolder-->viewmodels-->shell.js</p> <p>Scripts-->NewArea-->ControllerFolder-->main.js</p> <p>Then I changed paths for JS of durandal, for example in main.js:</p> <pre><code>define(['../../../App/durandal/app', '../../../App/durandal/viewLocator', '../../../App/durandal/system', '../../../App/durandal/plugins/router', '../../../App/services/logger'], </code></pre> <p>And I changed main.js in the next line:</p> <pre><code>viewLocator.useConvention('viewmodels', '../Areas/NewArea/Views/ControllerFolder/views'); </code></pre> <p>But that configuration of folders fails because the next line calls various times the module "viewLocator" in its definition and rewrite the configuration of "useConvention" with default value:</p> <pre><code>app.setRoot('viewmodels/shell', 'entrance'); </code></pre> <p>That behavior only happen when the folders "views" and "viewmodels" don't stay under "App" folder of "Durandal".</p> <p>Please help me, how to have various SPAs in the same project?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload