Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
121
rated 0 times [  123] [ 2]  / answers: 1 / hits: 15644  / 11 Years ago, fri, october 4, 2013, 12:00:00

I am new in angularJs .



This is my bit level view



<input type=text ng-model=todoName size=30
placeholder=Add Your Name>
<input type=text ng-model=todoAge size=30
placeholder=Add Your Age>
<input type=hidden ng-model=todoId />
<form style=display:'?????????' ng-submit=addTodo()>
<input class=btn-primary type=submit value=add>
</form>
<form style=display:'?????????' ng-submit=addTodo()>
<input class=btn-primary type=submit value=update>
</form>


and this is my angularjs bit level coding



$scope.DisplayUpdate = none;


I have one screan for manage student details, i want to show add button when first time at this time hide update button , and when update time to show update button and at this time add button was need to hide .



see this line for set to hide and show details in script side using angular js : $scope.DisplayUpdate = none;



How to i set this value in my button style ?



 <form style=display:'?????????' ng-submit=addTodo()>
<input class=btn-primary style=display:'?????????' type=submit value=add>
</form>

More From » angularjs

 Answers
36

You can use ng-show to hide it



<form ng-show=DisplayUpdate === 'none' ng-submit=addTodo()>
<input class=btn-primary type=submit value=add>
</form>


If you want to remove it from DOM tree, use ng-if



<form ng-if=DisplayUpdate === 'none' ng-submit=addTodo()>
<input class=btn-primary type=submit value=add>
</form>

[#75231] Thursday, October 3, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
janettejordynm

Total Points: 550
Total Questions: 94
Total Answers: 98

Location: Senegal
Member since Fri, Aug 21, 2020
4 Years ago
janettejordynm questions
Tue, Nov 24, 20, 00:00, 4 Years ago
Sat, May 23, 20, 00:00, 4 Years ago
Mon, Apr 6, 20, 00:00, 4 Years ago
Tue, Feb 18, 20, 00:00, 4 Years ago
;