title: Angular js: Iterate over list in view (ng-foreach)
body: <p>I am getting json data in server response and return that to $scope.questions</p>
  
  <p>I want to access this questions data in step1.html file.</p>
  
  <p>app.js</p>
  
  <pre><code> (function () {
      "use strict";
      var app = angular.module("autoQuote",["ui.router","ngResource"]);
  
      app.config(["$stateProvider","$urlRouterProvider", function($stateProvider,$urlRouterProvider){
          $urlRouterProvider.otherwise("/");
  
          $stateProvider
              .state("step1", {
                url : "/",
                templateUrl : "easyquote/step1.html",
                controller: "questionsCtrl",
              })  
              .state("step2", {
                url : "/step2",
                templateUrl : "easyquote/step2.html",
                controller: "questionsCtrl",
              })
      }]
      );
  }());
  </code></pre>
  
  <p>autoQuoteCtrl.js</p>
  
  <pre><code>(function () {
      "use strict";
  
      angular
      .module("autoQuote")
      .controller("questionsCtrl",["$scope","$http","$state",questionsCtrl]);
  
      function questionsCtrl($scope,$http,$state) {
          $http.get('rc1/getQuestions/' + $state.current.name)
               .then(function(response) {
                  $scope.questions = response.data;
          });   
      }
  }());
  </code></pre>
  
  <p>step1.html</p>
  
  <pre><code>    &lt;div ng-controller="autoQuoteCtrl"&gt;
          &lt;form name="DTOstep1" ng-submit="onSubmit()"&gt;
        &lt;label&gt;Email: &lt;/label&gt;&lt;input type="text" name="email" id="email" /&gt;
        &lt;br&gt;&lt;br&gt;
  
              &lt;table ng-repeat="questions in que"&gt;
                  &lt;tr&gt;
                  &lt;td&gt;{{que.QuestionData._attributeName}}&lt;/td&gt;
                  &lt;td&gt;&lt;/td&gt;
                  &lt;tr&gt;
              &lt;/table&gt;
        &lt;input type="submit" value="Save" /&gt;
      &lt;/form&gt;
      &lt;/div&gt;
  </code></pre>