【问题标题】:How can I cope with the language system in angular.js?如何应对 angular.js 中的语言系统?
【发布时间】:2016-10-30 16:38:15
【问题描述】:

我想做一个过滤器输入。但面临一个我无法解决的问题。

我的文件如下:

成语和短语.html

<!DOCTYPE html>
<html>
<script src= "angular.js"></script>
<body>
<div ng-app="myApp" ng-controller="EnglishCtrl">
<p>Filtering input:</p>
<p><input type="text" ng-model="test"></p>
<ul>
  <li ng-repeat="x in English | filter:test | orderBy:'English'">
    {{ (x.English | lowercase) + ', ' + x.Bangla }}
  </li>
</ul>
</div>
<script src="namesController.js"></script>
</body>
</html>

namesController.js

var app = angular.module('myApp', [])
app.controller('EnglishCtrl', function($scope) {
    $scope.English = [
        {English:'A black sheep', Bangla:'কুলাঙ্গার'},

    ];
});

还有我们所知道的 angular.js 文件。

但是当我运行它时,它给了我以下信息---

为什么?

我想活下去。请帮帮我。

【问题讨论】:

  • 先生,请给我一些资源,因为现在我是反应新手@Abdennour TOUMI
  • 首先,看这个例子:jsfiddle.net/abdennour/69z2wepo/61297 .. 这是基本的例子
  • 然后,转到this page 并选择其中一门课程开始。
  • 这与 Angular 无关。您期望浏览器使用 Unicode 而没有被告知期望它,然后向它提供 Unicode 字符。请参阅@charlietfl 的解决方案。大多数浏览器的默认配置是使用 ISO-8859-1,它不支持印地语字符 - 这就是为什么您需要告诉浏览器使用 Unicode,而 UTF-8 只是其中一个版本。编辑:stackoverflow.com/questions/12406066/…

标签: javascript angularjs


【解决方案1】:

尝试设置&lt;meta&gt; charset

<meta charset="utf-8" />

显示的代码在 this demo 中可以正常工作

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-08
    • 1970-01-01
    • 1970-01-01
    • 2021-10-04
    相关资源
    最近更新 更多