Angular template view with utf-8 chars doesn't work

天大地大妈咪最大 提交于 2019-12-11 13:19:33

问题


I try to use "ngroute" to load html templates.
Everything works fine, but when I try to show words in Hebrew in the "ng-view", I get only question marks instead of the Hebrew chars (???????????).
in the <head> tag I added <meta charset="utf-8"> and if the Hebrew is static in the page it works fine. but when I use "ngroute" to load it it doesn't.

<head>

<!-- start: Meta -->
<meta charset="utf-8">
<title></title>
<!-- end: Meta -->

<script src="js/angular.min.js"></script>
<script src="js/angular-route.min.js"></script>

<script src="js/controllers.js"></script>

<script src="js/jquery-1.9.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>

<!-- end: CSS --></head>

Any idea? Is there anything I should add to the html view page?


回答1:


I added the <meta meta charset=utf-8> tag to the all the templates html and not just to the <head> and it fixed the problem.




回答2:


I've solved by resaving the html template file with utf-8 encoding. In Visual Studio, Save As > Save with Encoding... button.



来源:https://stackoverflow.com/questions/39436890/angular-template-view-with-utf-8-chars-doesnt-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!