Base solution for your next web application
BLACK FRIDAY
From Nov 21
To Dec 1
XXDAYS : XXHRS : XXMIN : XXSEC
SAVE UP TO$3K
Also valid for the
existing customers!
Open Closed

Simple angularjs question app.js #727


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)
  • 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.