I'm currently working on a project that involves adding an input field and a button each time a user clicks on the button.
Is there a way to retrieve the text from the input field when the new button, which is displayed alongside the input field, is clicked?
Check out my example on CodePen
var app = angular.module('ionicApp',['ionic']);
app.controller('cntr',function($scope){
$scope.addfield=function(){
alert("how to add input field dynamically")
}
})
I'm not quite sure how to achieve this; in jQuery we can use the append function, like this:
$('.addcontend').append('<input \> <button>get input value</button>')
Can anyone guide me on how to do this using AngularJS?