Angularjs 如何在元素输入模式中设置输入法模式?

Angularjs 如何在元素输入模式中设置输入法模式?,angularjs,input,Angularjs,Input,我在学校读书 如何在此代码中设置ime模式 您可以向输入中添加其他属性(不会导致任何错误),因此只需添加,例如,style=“ime mode:disabled”(或者添加class属性,并在css中设置ime mode,我认为这是更好的方式)ime mode在Chrome、Safari或Opera中不受支持。在此处阅读有关ime模式及其兼容性的更多信息: 如果您确实希望在受支持的IE和Firefox版本中使用它,以下是两种方法: 使用一个类: 内联样式(不推荐): 还要注意的是,在您的标

我在学校读书


如何在此代码中设置ime模式


您可以向输入中添加其他属性(不会导致任何错误),因此只需添加,例如,
style=“ime mode:disabled”
(或者添加
class
属性,并在css中设置
ime mode
,我认为这是更好的方式)

ime mode
在Chrome、Safari或Opera中不受支持。在此处阅读有关ime模式及其兼容性的更多信息:

如果您确实希望在受支持的IE和Firefox版本中使用它,以下是两种方法:

使用一个类: 内联样式(不推荐):

还要注意的是,在您的标记中是无效的<代码>输入标记是自动关闭的,不需要
。另外,对于angular,您可能不需要
名称
必需的
属性。您可能会看到这样的标记:

<input
  ng-model="myModel"
  ng-required="required"
  ng-minlength="minLength"
  ng-maxlength="maxLength"
  ng-pattern="regex"
  ng-change="myChangeFunction()"
>

谢谢但它可以在IE9中运行,所以我在chrome上测试了我的示例,我遇到了这个问题。也许chrome无法在元素输入中使用属性style=“ime模式:禁用”?
<input class="ime">
.ime {
  ime-mode: disables;
}
<input
  ng-model="myModel"
  ng-required="required"
  ng-minlength="minLength"
  ng-maxlength="maxLength"
  ng-pattern="regex"
  ng-change="myChangeFunction()"
>
app.controller('myCtrl', function($scope) {
  $scope.myModel = 'input value here';
  $scope.required = true;
  $scope.minLength = 5;
  $scope.maxLength = 20;
  $scope.regex = '/put your regex here/';
  $scope.myChangeFunction() {
    //code to run when value of input is changed
  };
});