Base solution for your next web application
Open Closed

Simple angularjs question app.js #727


User avatar
0
hans abelshausen created

Hi, I have a simple question, how to get path of a cshtml which is two Levels above app.js

.state('customHome', {
                     url: '/',
                     controller: 'Test.controllers.views.home.home as vm',
                     templateUrl: '/../../Custom/test.cshtml',
                     menu: 'CustomHome'
                 })

my tree structure Looks like: Test App Main app.js

Test Custom test.cshtml test.js

Thanks in advance.


1 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    I generally use absolute path:

    templateUrl: abp.appPath + 'Test/Custom/test.cshtml'
    

    abp.appPath provides the root path of your application (it properly works also for virtual directories).

    Relative paths can be problematic with bundling. If you can find a good way, please share with us.