Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialgurpreet singh
9,625 Pointshow to clear text from inputbox in angularjs when inputbox are created dynamically using ng-repeat and json file
when user focus on the input box it should delete the text written inside(taken from json file) how we create clear function in angular that remove the text as edited it first time and after it is edited, the text remain
1 Answer
Nure México
25,840 PointsSupposing ng-model=“batman” is in the textfield, you can add this to your textfield
<input type=“text” ng-focus=“batman=nil” ng-model=“batman”>
This will delete the text each time it is clicked, when you end editing the text will remain
gurpreet singh
9,625 Pointsgurpreet singh
9,625 Pointsthanx it works