Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在ng重复中隐藏和显示_Javascript_Jquery_Angularjs - Fatal编程技术网

Javascript 在ng重复中隐藏和显示

Javascript 在ng重复中隐藏和显示,javascript,jquery,angularjs,Javascript,Jquery,Angularjs,我的问题是,如果表达式为true,则隐藏输入框。 如果我手动给出id,它会隐藏输入框,但在循环中它不起作用。我认为这条线是问题的根源: $scope.hideinputbox = function (k) { $("input#k").hide(); } 您的函数是错误的。您总是使用字符串调用函数,而不是使用k变量调用函数。按如下方式更改代码: <input type="text" placeholder="Enter valueg" class="form-

我的问题是,如果表达式为true,则隐藏输入框。 如果我手动给出id,它会隐藏输入框,但在循环中它不起作用。我认为这条线是问题的根源:

$scope.hideinputbox = function (k) { 

      $("input#k").hide();
     }

您的函数是错误的。您总是使用字符串调用函数,而不是使用k变量调用函数。按如下方式更改代码:

<input type="text" placeholder="Enter valueg"  class="form-control" name="cvalue" id="{{T.id}}"  ng-model="T.cvalue"  required/>
正如@katmanco所说的,不要将jQuery与AngularJS一起使用

但是为什么你要隐藏你的元素,同时也有ng show

$scope.hideinputbox = function (k) { 

      $("input#" + k).hide();
     }

{{K.amount}}

如果您的
ng show=“condition”
为false,它将被隐藏,因此我认为您不需要函数

您的函数是错误的。您总是使用字符串k调用函数,而不是使用k变量。按如下方式更改代码:

<input type="text" placeholder="Enter valueg"  class="form-control" name="cvalue" id="{{T.id}}"  ng-model="T.cvalue"  required/>
正如@katmanco所说的,不要将jQuery与AngularJS一起使用

但是为什么你要隐藏你的元素,同时也有ng show

$scope.hideinputbox = function (k) { 

      $("input#" + k).hide();
     }

{{K.amount}}

如果你的
ng show=“condition”
为false,它将被隐藏,因此我认为你不需要该函数

试着不要将Jquery与Angular Js一起使用。这是一种糟糕的做法。试着不要将Jquery与Angular Js一起使用。这是一种糟糕的做法。