title: AngularJS : How to read data of JSON file on button click?
body: <p>I want to call a function on button click in which HTTP called to read data from JSON file , Following code is working fine when HTML loads the data from JSON file is loading on <code>&lt;ul&gt;</code> but I want to call function on button (Continue button) click , How can I achieve this? because when I encoded <code>http.get</code> method in a function and calls on button click it doesn't work .</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code> &lt;label class="item"&gt;
                &lt;button class="button button-block button-positive" id="ForgotPasswordSubmit" type="submit"  ng-disabled="ForgotPasswordForm.$invalid" &gt;Continue&lt;/button&gt;
  
              &lt;/label&gt;
      &lt;ul&gt;
        &lt;li ng-repeat="x in loginData"&gt;
          {{ x.result +','+ x.status}}
        &lt;/li&gt;
      &lt;/ul&gt;
  </code></pre>
  
  <p><strong>SignupCtrl.js</strong></p>
  
  <pre><code>use strict';
  angular.module('User').controller('SignupCtrl', ['$scope', '$http','$state', "SettingService", function($scope,$http, $state, SettingService) {
  
      /*LoginCtrl code will come here*/
      var vm = this;
  
   vm.signup = function(){
    $state.go('app.orderlist');
   };
  
  
   $http.get("forgotpassword.json").success(function (data) {
        $scope.loginData = data;
  
    });
  
  }]);
  </code></pre>