具有utf-8字符的角度模板视图不起作用 [英] Angular template view with utf-8 chars doesn't work

查看:54
本文介绍了具有utf-8字符的角度模板视图不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用"ngroute"加载html模板.
一切正常,但是当我尝试在"ng-view"中以希伯来语显示单词时,我只收到问号,而不是希伯来字符(???????????).
< head> 标记中,我添加了< meta charset ="utf-8"> 并且如果希伯来语在页面中是静态的,则可以正常使用.但是当我使用"ngroute"加载它时却没有.

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>

有什么主意吗?我应该添加到html视图页面中的任何内容吗?

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

推荐答案

我将< meta meta charset = utf-8> 标记添加到了所有模板html中,而不仅是添加到了< head> 并解决了该问题.

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.

这篇关于具有utf-8字符的角度模板视图不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆