title: Want display user selected image in different ejs file
body: <p>I am displaying user selected image in my ejs file, but i want the user selected image in different ejs file.</p>
  
  <p>Ejs file</p>
  
  <pre><code>&lt;html&gt;
  
  &lt;head&gt;
  
  &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.min.js"&gt;
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;div class="container"&gt;
      &lt;div class="row" ng-controller="PatientEmrController"&gt;
          &lt;h1&gt;Upload a file&lt;/h1&gt;
          &lt;div class="col-sm-4"&gt;
              &lt;form ng-submit="uploadFile()" class="form"&gt;
                  &lt;input type="text" placeholder="title" ng-model="titleText" class="form-control" required&gt;
                  &lt;br&gt;&lt;br&gt;
  
  
  &lt;file-field ng-model="uploadThis" class="btn" ng-class="{'btn-success':uploadThis}" preview="uploadPreview" name="up" accept="image/png,image/jpg,image/jpeg"&gt;Select file&lt;/file-field&gt;
                  &lt;br&gt;&lt;br&gt;
                  &lt;input type="submit"&gt;
              &lt;/form&gt;
          &lt;/div&gt;
          &lt;div class="col-sm-4"&gt;
              &lt;img ng-src="{{uploadPreview}}" ng-if="uploadPreview" class="img-responsive" &gt;   
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  
  &lt;/html&gt;
  </code></pre>
  
  <p>Js file</p>
  
  <pre><code>sample.controller('PatientEmrController',['$scope','$http','$injector',function($scope,$http, $injector){
  
  
  
      //  $injector.invoke(ParentCtrl, this, {$scope: $scope});
  
  
      // $scope.title = 'project';
      // $scope.image_url = 'images/generic.jpg';
      // $scope.image_num = 14; //image count -&gt; [0.jpg, 1.jpg, 2.jpg, ..., 13.jpg]
  
  
  
  
  $scope.myFunction = function(){
         return "https://www.google.co.in/images/srpr/logo11w.png"
         // return "uploadPreview"
      }
  
      $scope.uploadFile=function(n){
  
          if(!$scope.uploadThis){
              alert('Please select a file to upload.')
              return;
          }
  
  
  
  
  
  
          var fd = new FormData();
  
          //you can also send other fields
          //this will be available as req.body.title
          //NOTE: files must be added AFTER other form data
          fd.append('title', $scope.titleText);
  
          //nacho relates to what we called the file
          //in the api on sails
          fd.append('nacho', $scope.uploadThis);
          $http.post('/api/burrito', fd, {
              //transformRequest: angular.identity,
              //headers: {'Content-Type': undefined}
              up:$scope.uploadThis,
              title: $scope.titleText,
              transformRequest: angular.identity,
              headers: {'Content-Type': undefined}
          })
          .success(function(data){
              console.log('upload data',data);
              if(data.result){
  
                  alert('file uploaded. See .tmp/uploads folder.');
              }
  
  
          })
          .error(function(err){
              alert('there was an error uploading the file.');
              console.log(err);
          });        
      }
  
  
  }]);
  </code></pre>
  
  <p>In this js file, i used myFunction,and i bind this function in the ejs file(in which i want to display user selected image, i used this function in ng-src).so here, one image return in that ejs file, because , i write one image url, so google image return , so i want to return user selected image here, how is it possible? </p>