title: Fetch data from database in angularjs to form
body: <p>In front page there are two options:</p>
  
  <p>1.create new</p>
  
  <p>2.edit</p>
  
  <p>1.it goes to index.html</p>
  
  <p>2.it should be goes to index html with data(data should be load from database)</p>
  
  <p>//get data from database</p>
  
  <pre><code>$scope.getItem = function(id) {
                 var auth = btoa("root:root");
                 $scope.form["@class"] = "ProjectDetails";
                 $http.defaults.headers.common.Authorization = 'Basic ' + auth;
                 $http.get("http://azuspeedcp01:2480/document/InternalRPA/"+id+"/*:-1", {
  
  
                     })
                     .then(function(response) {
  
                     console.log(response);
                     $scope.form=response.data; 
  
                     });       
  
    }
  </code></pre>
  
  <p>here i retrieve data from db is fine.its <strong>response.data</strong>
  again assign to $scope.form which is the object i passed from form to submit data.</p>
  
  <p>//index.html(partial)</p>
  
  <pre><code>&lt;input type="text" id="clientName" ng-model="form.ClientName"&gt;
  &lt;input type="text" id="initiate" ng-model="form.City"&gt;
  &lt;select id="Geo" ng-model="form.Geo"&gt;
      &lt;option value="North America"&gt;North America&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>How to route to index.html with data. I don't have idea.please help me.</p>