我会使用什么样的文件路径NG-包括哪些内容? [英] What file path would I use with ng-include?
本文介绍了我会使用什么样的文件路径NG-包括哪些内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的角度项目的路径是这样的。
My angular project's path is like this
web
server.py ##flask server program
app
static
app.js
controllers.js
etc...
templates
index.html
home.html
index.html的
index.html
<!-- this didn't work -->
<ng-include src="templates/home.html"><ng-include>
<!-- nor did this -->
<ng-include src="home.html"></ng-include>
home.html的
home.html
<h1> home! </h1>
除了我没有看到的部分(home.html做为)在我的输出。
Except I don't see the partial (home.html) in my output.
任何人看到我的错误呢?
Anyone see my mistake?
推荐答案
的src属性NG-包括预计的字符串。无论你传递一个作用域变量,或者直接传递字符串。
The src attribute of ng-include expects a string. Either you pass a scope variable, or pass string directly.
<ng-include src=" 'templates/home.html' "></ng-include>
这篇关于我会使用什么样的文件路径NG-包括哪些内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文