How do I use a layout as a master page across multiple projects

25 views
Skip to first unread message

shashank dhasal

unread,
Jul 20, 2016, 1:33:48 AM7/20/16
to DurandalJS

I am learning durandaljs


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

The project structure is as below


 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.


shashank dhasal

unread,
Jul 20, 2016, 1:39:56 AM7/20/16
to DurandalJS

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. Also I am using durandal framework for web master pages

Reply all
Reply to author
Forward
0 new messages