亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

angular.js - Angular uses ng-include, why can't it generate html code?
怪我咯
怪我咯 2017-05-15 16:57:57
0
4
629

When I was learning angularJS today, the video talked about the usage of ng-include.
To put it bluntly, it is just to extract the common html code into an html file and then include it.

But when I introduce product-title.html in the same directory in index.html, the content in product-title.html is not displayed.

angular version is 1.4.8

index.html:

<h3 ng-include="'product-title.html'"></h3>

product-title.html:

{{product.name}}
<em class="pull-right">{{product.price | currency}}</em>

Look at what the debugging interface generates:

<!-- ngInclude: a.html -->

Such a sentence.

怪我咯
怪我咯

走同樣的路,發(fā)現(xiàn)不同的人生

reply all(4)
給我你的懷抱

It’s because the page is not run on the http server.

劉奇

Is there a problem with the path? Check to see if they are of the same level. product-title.htmlindex.html

黃舟

Look in the browser, is the html 404? Confirm the file path~

淡淡煙草味

The value of ng-include must be a variable, not a file name. Assign the file path to a variable, then ng-include='variable name'

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template