Click here to Skip to main content
15,884,810 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am learning durandal.js in MVC

I have a solution file where I am having multiple projects.

project Structure
C#
MainSolution
---Applications(Folder)
         |---Project1(csproj)
                 |---App
                       |---View (html pages)
                            |---shell.html
                       |---ViewModels (js)
                            |---shell.js
                       |---main.js
         |---Project2(csproj)
                 |---App
                       |---View (html pages)
                            |---shell.html
                       |---ViewModels (js)
                            |---shell.js
                       |---main.js
---CommonProject(csproj)
     |---App
          |---View (html pages)
                 |---shell.html
          |---ViewModels (js)
                 |---shell.js
          |---main.js

Now as durandal uses shell as a master page, I want all the projects(Project1, Project2) to share the shell.js from the commonProject.


And in the compose binding we will pass the view to the shell in the common folder from Project1 (or Project2).

I don't know how do I achieve this.

Any help is appreciated.

What I have tried:

created a 3 projects
Project1
Project2
Common

In Project1/App/main.js

require.config({
paths: {
'text': '../Scripts/text',
'durandal': '../Scripts/durandal',
'plugins': '../Scripts/durandal/plugins',
'transitions': '../Scripts/durandal/transitions',
'Common': '../../../Common'
}
});

and in app.start()
app.setRoot('Common/viewmodels/shell', 'entrance');


Set Project1 as startup.


This gives as 404 and cannot find the mentioned common shell file.

I am not sure if this approach is correct.
Posted
Updated 18-Jul-16 4:08am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900