While creating a UI for the web apps, we come up with the situation where we want to get the same type of information from the user. In some situation, we have no idea about the number of that particular type of information the user wanted to provide. In this situation, we come with the solution to dynamically add the field or group of fields based on the user interaction with the form element. For e.g.: user's phone number- User will decide the number of phones it wishes to enter into the form. The idea is simple. We will provide the user a way to add the number of fields it requires. There is also a possibility when the user wishes to remove the previously added fields. To implement the dynamic fields addition, we will use ng-repeat directive to render the fields or group of fields. This ng-repeat directive is to be defined on the div element which wraps the markup for the fields which is to be dynamically added. Let jumps into the code. For the awesome look we will use ...
Tips and Tricks to make your Angular life Easy and Simple