Reputation: 233
I have hided an element using ng-hide. Then tried to show it using a function. but it is not showing..
<input type="button" class="btn btn-primary btn-sm margin-right-15 ng-hide" value=" Edits "
ng-click="EditValueSalComponent(T,p,K)" id="{{'in'+T.id}}"/>
<div ng-if="(p.id == K.emp_id && T.id == K.component_id)">
{{K.amount}}
<div ng-init="hideinputbox(T.id)"></div>
</div>
$scope.hideinputbox = function (k) {
$("input#in" +k).show();
}
Upvotes: 0
Views: 45
Reputation: 750
I totally agree with the answer provided by @anik, but just to add on. Whenever you are performing an operation out of the context of angular (via a 3rd party lib or framework like jQuery). The scope values would not be updated as the digest cycle is not triggered . Thats why it is important that you always stay within the angulars execution context.
Upvotes: 0
Reputation: 25352
You have to do it angular way .
Like this
<input type="button" ng-hide="T.hideMe" class="btn btn-primary btn-sm margin-right-15" value=" Edits "
ng-click="EditValueSalComponent(T,p,K)" id="{{'in'+T.id}}"/>
<div ng-init="hideinputbox(T)"></div>
JS
$scope.hideinputbox = function (k) {
k.hideMe=!k.hideMe
}
Upvotes: 3