How do I access data that is inside my modal


I have an ionic modal like this:

<div class="modal">
    <div class="padding">
      <div class="list">
        <label class="item item-input">
          <span class="input-label">Name</span>
          <input ng-model="name" type="text">
        <button class="button ng-click="addMessage()">Comment</button>

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 $ gives out null


You do it right but you should use vars like “” (it’s an angular problem)
Check this


Can you explain a bit.


According to the article above having a ‘.’ in your models will ensure that prototypal inheritance is in play. So, use
<input type="text" ng-model="someObj.prop1"> rather than
<input type="text" ng-model="prop1">.


Ok suppose if i use ng-model=""

Then in my controller, I would do $ ?


Yes, just like that.