Cannot get input value from md-input
<p>I have this md-dialog which has an input. I'm passing the model of the input when I click the top up button but on my controller, it is undefined.</p>

<pre><code>&lt;md-dialog aria-label="Top Up User" ng-cloak&gt;
  &lt;md-dialog-content&gt;
    &lt;div class="md-dialog-content"&gt;
      &lt;form&gt;
        &lt;md-input-container class="md-block"&gt;
                &lt;label&gt;Amount&lt;/label&gt;
                &lt;input required type="number" name="amount" ng-model="topup.amount" min="1"
                ng-pattern="/^1234$/" /&gt;
        &lt;/md-input-container&gt;

        &lt;md-dialog-actions layout="row" ng-show="!vm.loading"&gt;

            &lt;md-button ng-click="vm.closeDialog()"&gt;
             Cancel
            &lt;/md-button&gt;
            &lt;md-button ng-click="vm.topUp(topup.amount)" style="margin-right:20px;"&gt;
              Top Up
            &lt;/md-button&gt;
          &lt;/md-dialog-actions&gt;

          &lt;div layout="row" layout-align="space-around"&gt;
            &lt;md-progress-circular md-mode="indeterminate" ng-show="vm.loading"&gt;&lt;/md-progress-circular&gt;
          &lt;/div&gt;
      &lt;/form&gt;
    &lt;/div&gt;
  &lt;/md-dialog-content&gt;
&lt;/md-dialog&gt;
</code></pre>

<p>Controller:</p>

<pre><code>(function(){

  angular
       .module('app')
       .controller('MainController', [
          'navService', '$mdSidenav', '$mdDialog', '$log', '$q', '$state', '$mdToast', 'Pubnub', 'mongolabService', '$scope',
          MainController
       ]);

  function MainController(navService, $mdSidenav, $mdDialog, $log, $q, $state, $mdToast, Pubnub, mongolabService, $scope) {

    var vm = this;

    function showActions($event) {
      var self = this;

      $mdDialog.show({
        controller: [ '$mdDialog', TopUpController],
        controllerAs: 'vm',
        templateUrl: 'app/views/partials/topup.html',
        targetEvent: $event,
        bindToController : true,
        clickOutsideToClose:true
      });

        function TopUpController () {
          var vm = this;
          vm.topUp = topUp;
          vm.loading = false;
          vm.closeDialog = closeDialog;
          function closeDialog() {
            $mdDialog.hide();
          }
          function querySearch (query) {
            return query ? $scope.users.filter( createFilterFor(query) ) : $scope.users;
          }

          function topUp(amount) {

            var topUpCallback = {
              error: function(response){
                vm.loading = false;
                showSimpleToast("Error occurred");
                console.log(response);
              }, success: function(response){
                showSimpleToast("Top up success");
              }
            }
            //Amount is undefined
            showSimpleToast("amount: " + amount);
          }

        }
    }

    function showSimpleToast(title) {
      $mdToast.show(
        $mdToast.simple()
          .content(title)
          .hideDelay(2000)
          .position('bottom right')
      );
    }
  }

})();
</code></pre>