问题
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