Having an issue with my Ionic framework setup using AngularJS. I am unable to access the input field "groupName" in my controller, as it always returns "undefined".
I was under the impression that using ng-model would automatically add it to the controller's scope?
<ion-pane>
<ion-header-bar align-title="left" class="bar-positive">
<div class="buttons">
<button class="button" ng-click="saveNewGroup()">Save</button>
</div>
</ion-header-bar>
<ion-content>
<div class="list">
<label class="item item-input">
<input type="text" placeholder="Name" ng-model="groupName">
</label>
</div>
</ion-content>
The relevant code snippet from my controller:
$scope.saveNewGroup = function() {
console.log($scope.groupName); // The value stays "undefined"
};