Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

send $scopes #707

Closed
javarv87 opened this issue Apr 29, 2015 · 0 comments
Closed

send $scopes #707

javarv87 opened this issue Apr 29, 2015 · 0 comments

Comments

@javarv87
Copy link

I have this code on html

       <div class="form-group">
          <label>Nombre:</label>
          <input type="text" class="form-control" ng-model="tecnologia.name">
        </div>        
        <div class="form-group">
          <label>Descripción:</label>          
          <textarea class="form-control" ng-model="tecnologia.description"></textarea>        
        </div>   
        <div class="form-group">
          <label for="productImage">Ingresa una imagen principal</label>            
          <div class="btn-file">
              <input type="file" ngf-select="upload(files)" ng-model="files">
                <button class="btn btn-success">
                <i class="fa fa-picture-o"></i> Seleccionar Foto
              </button> 
              <b>{{files[0].name}}</b>
              {{progressPercentage}}
              <img ng-show="files[0] != null" ngf-thumbnail="files[0]" class="img-circle">
          </div>
            <div class="progress" ng-show="progress >= 0">
            <div class="progress-bar bg-teal" role="progressbar" aria-valuenow="{{progress}}" aria-valuemin="0" aria-valuemax="100" style="width: {{progress}}%;">{{progress}}%</div>
          </div>
        </div>
        <button class="btn btn-primary" type="button" ng-click="getTechnology(tecnologia, files); saveTechnology(tecnologia)"><i class="fa fa-save"></i> Guardar</button> <button class="pull-right btn btn-warning" type="submit" ng-click="deleteTechnology(tecnologia)"><i class="ion-trash-b"></i> Eliminar</button>

and this in js

  $scope.getTechnology = function(tecnologia, files){       
    if (files && files.length) {
      for (var i = 0; i < files.length; i++) {
        var file = files[i];  
        var name = tecnologia.name;
        var description = tecnologia.description;        
        Upload.upload({
          url: 'tecnologias',  
          data: { // i want to get this data on backend
            'tecnologia': [{
              'name' : name,
              'description' : description  
            }]            
          },        
          file: file    
        })
        .success(function(data){
          console.log(data);
        })      
      }
    }

and this route on F3

$f3->route('POST /tecnologias',
    function($f3) { 
        GLOBAL $db;         
        $error = '';                
        if(isset($_FILES['file'])){
            $file = $_FILES['file'];            
            var_dump($file);

        }
         }
);

i want to known how can i get the $scope data that i send on the backend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants