如何隐藏< td>在页面加载angularjs里面包含一个选择框? [英] How to hide a <td> upon page load in angularjs which contains a select box inside?

查看:70
本文介绍了如何隐藏< td>在页面加载angularjs里面包含一个选择框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在寻找一种方法来隐藏页面加载时位于标签内的选择框。我将需要操作它并稍后使用函数将其备份。所以我不想硬编码隐藏。



我的表是:



Hi,

I am looking for a way to hide a select box which is located inside a tag upon page load. I will need to manipulate it and bring it backup using a function later. So I dont want to hardcode the hide.

My table is :

<table ng-table="talentPoolList" show-filter="true" class="table table-striped table-bordered">
                    <tr ng-repeat="employee in data | filter: testFilter">

                        <td data-title="'#'">{{$index + 1}}</td>
 <td data-title="'Select Account'" ng-hide="showhide">
                            <select>
                                <option disabled selected value> -- select an option -- </option>
                                <option id="selectedLocked">Blocked</option>
                                <option id="selectedBilled">Billed<//option>
                                <option id="selectedShadow">Shadow</option>
                                <option id="selectedOnNotice">OnNotice</option>
                                <option id="selectedPOC">POC</option>
                            </select>
                        </td>
</table>







任何人都可以告诉我如何在页面上隐藏加载?



我在控制器中使用工厂...所以我会显示我的控制器看起来如何你想在那里添加代码来隐藏td。请举例说明我是棱角分明的新手并不知道如何实现这个目标。

我的控制器:






Can anyone show me how to hide that on page load?

I use factory in controller... So Ill show how my controller looks in case you want to add code there to hide the td. Please show with an example as I am new to angular and have no clue how to achieve this.
My controller :

//Factories
myApp.factory('employeeTalentPoolServices', ['$http', function ($http) {

    var factoryDefinitions = {
getAllBenchers: function () {
            return $http.get(myApp.TalentPoolBaseUrl + '/EmployeeState?state=&pageNumber=0&pageSize=0').success(function (data) { return data; });
                     }
}

    return factoryDefinitions;
}
]);
//Controllers

myApp.controller('getAllBenchersController', ['$scope', 'employeeTalentPoolServices', function ($scope, employeeTalentPoolServices) {
    employeeTalentPoolServices.getAllBenchers().then(function (result) {
        $scope.data = result.data;
        $scope.testFilter = function (item) {
            return (item.state.state.toLowerCase() === 'available' || item.state.state.toLowerCase() === 'blocked');
        }
    });
    
}]);









谢谢提前



我尝试了什么:



我是AngularJS的初学者,我不知道怎么做这个。





Thanks is advance

What I have tried:

I am a beginner in AngularJS and I dont have a clue how to do this.

推荐答案

index + 1}}< / td>
< td data-title ='选择帐户'ng-hide =showhide>
< select>
<选项已禁用所选值> - 选择一个选项 - < / option>
< option id =selectedLocked>已屏蔽< /选项>
< option id =selectedBilled>结算< //选项>
< option id =selectedShadow> Shadow< / option>
< option id =selectedOnNotice> OnNotice< / option>
< option id =selectedPOC> POC< / option>
< / select>
< / td>
< / table>
index + 1}}</td> <td data-title="'Select Account'" ng-hide="showhide"> <select> <option disabled selected value> -- select an option -- </option> <option id="selectedLocked">Blocked</option> <option id="selectedBilled">Billed<//option> <option id="selectedShadow">Shadow</option> <option id="selectedOnNotice">OnNotice</option> <option id="selectedPOC">POC</option> </select> </td> </table>







任何人都可以告诉我如何在页面上隐藏加载?



我在控制器中使用工厂...所以我会显示我的控制器看起来如何你想在那里添加代码来隐藏td。请举例说明我是棱角分明的新手并不知道如何实现这个目标。

我的控制器:






Can anyone show me how to hide that on page load?

I use factory in controller... So Ill show how my controller looks in case you want to add code there to hide the td. Please show with an example as I am new to angular and have no clue how to achieve this.
My controller :

//Factories
myApp.factory('employeeTalentPoolServices', ['


http',function(
http', function (


http){

var factoryDe​​finitions = {
getAllBenchers:function(){
return
http) { var factoryDefinitions = { getAllBenchers: function () { return


这篇关于如何隐藏&lt; td&gt;在页面加载angularjs里面包含一个选择框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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