I've been experimenting with Angular and I'm trying to save a user's name input into a variable. Ideally, when the user types their name and clicks "Next," I want to capture that data from the input field and store it in a variable. Is this possible, and if so, what is the most effective way to do it? Below is an example that is not currently working:
HTML:
<button class="button" ng-click="next()"> Next</button>
<form>
<label class="item">
<input ng-model="name" type="text" placeholder="Enter your name"></input>
</label>
</form>
<h3 style="color:black">{{name}}</h3>
JS:
$scope.next = function() {
var nameresult = $scope.name;
};