I have an ionic modal like this:
<div class="modal">
<ion-header-bar>
</ion-header-bar>
<ion-content>
<div class="padding">
<div class="list">
<label class="item item-input">
<span class="input-label">Name</span>
<input ng-model="name" type="text">
</label>
<button class="button ng-click="addMessage()">Comment</button>
</div>
</div>
</ion-content>
</div>
And in my controller:
$ionicModal.fromTemplateUrl('templates/modal.html', function (modal) {
$scope.modal = modal;
},{
scope: $scope,
animation: 'slide-in-up',
focusFirstInput: true
});
Now I want to access ng-model="name"
inside my controller, how do i do it. Just simple $scope.name
gives out null