简体   繁体   English

Angular模板仅从MeteorJS的根目录加载

[英]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. 我是流星新手,在本教程决定将我的MEAN堆栈应用程序之一迁移到流星之后。 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'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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