AngularJS可以';找不到嵌套的模板文件
我和AngularJS一起工作,有一个简单但奇怪的问题。如果我的模板文件位于特定目录的子目录中,AngularJS将无法找到它 下面的项目结构是我想要的。我引用AngularJS可以';找不到嵌套的模板文件,angularjs,Angularjs,我和AngularJS一起工作,有一个简单但奇怪的问题。如果我的模板文件位于特定目录的子目录中,AngularJS将无法找到它 下面的项目结构是我想要的。我引用myFile.html时,使用组件templateUrl:“/MyApp/posts/myFile/myFile.html”上的templateUrl属性,使用以下结构和此导入,AngularJS抛出错误 public | javascript | MyApp | posts | app.js
myFile.html
时,使用组件templateUrl:“/MyApp/posts/myFile/myFile.html”
上的templateUrl属性,使用以下结构和此导入,AngularJS抛出错误
public
| javascript
| MyApp
| posts
| app.js
| index.html
| myFile
myFile.html
如果我将我的结构重新格式化为下面的格式,并将导入更改为templateUrl:“/MyApp/myFile/myFile.html”
一切正常
public
| javascript
| MyApp
| posts
| app.js
| index.html
| myFile
| myFile.html
请不要建议我检查拼写和文件路径。我已经做了一百万次了,如果它在posts目录的子目录中,它就永远不起作用了你在运行开发服务器吗?如果是,您可以通过获取/浏览
http://localhost/MyApp/myFile/myFile.html
?您好,谢谢您的评论。事实证明,这是巴贝尔如何处理项目的问题。我们团队的另一位成员能够解决这个问题:)