Click here to Skip to main content
15,905,508 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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>



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');
        }
    });
    
}]);




Thanks is advance

What I have tried:

I am a beginner in AngularJS and I dont have a clue how to do this.
Posted
Comments
Karthik_Mahalingam 22-Sep-16 2:47am    
$scope.showhide = false
Member 12332582 22-Sep-16 2:48am    
in the controller?
Member 12332582 22-Sep-16 2:49am    
because I need to show it again using a function in controller
Karthik_Mahalingam 22-Sep-16 2:51am    
ok in that function
$scope.showhide = false.
Karthik_Mahalingam 22-Sep-16 2:50am    
yes in the controller.
$scope.showhide = true // on load.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900