i am having play around with angular and i am trying to store a name entry to a variable. When you type your name in and click next i want to take the data from the input field and store that into a variable. Can this be done and if so whats the best way to go about this? iv provided a non working example below
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;
};
nameresultwill be local to thenextfunction