简体   繁体   中英

Angular template only loading from root directory in MeteorJS

I am new to meteor, and after the tutorial have decided to migrate one of my MEAN stack applications to meteor. The problem I'm having is that the exact same angular route works when the location of the template file is in the root directory, but then does not work when I put it a different one.

This one works:

$stateProvider
  .state('winery_selection', {
    url: '/',
    templateUrl: 'winery_selection.ng.html',
    controller: 'WinerySelectionController',
  })

This one does not pick up the template at all:

$stateProvider
  .state('winery_selection', {
    url: '/',
    templateUrl: '/client/app/views/winery_selection.ng.html',
    controller: 'WinerySelectionController',
  })

The only thing I have changes is the location of the file and this line of code, respectively.

Any thoughts on why it only works from the root directory?

看来您需要从网址中删除开头的\\

templateUrl: 'client/app/views/winery_selection.ng.html'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM