Hello,

I´m having troubles doing AJAX with $http

I´m doing something wrong, can you help me please


can i post the code here?


thats the view:

 <div ng-controller="mc300">
                    <div class="container-fluid" style="margin-top:75px;">
                        <div class="fondo-blue col-xs-12 col-sm-12 
col-md-10  col-sm-offset-0 col-md-offset-1">  
                            <div class="col-xs-12 col-sm-12 col-md-12 
 col-sm-offset-0 col-md-offset-0" style="color:#585858;" ng-repeat="post300 
in posts300">
                                <table width=100% 
id="{{post300.nuevoVisible}}" style="display:block; border-bottom:solid 1px 
#C0C0C0;">
                                    <tr>
                                        <td 
width=50%><b>{{post300.tituloVacante}}</b></td>
                                        <td width=50%><b>Lugar de 
trabajo:</b> {{post300.idCiudad}} - {{post300.idPais}}</td>
                                    </tr>
                                </table>
                                
                                <table width=100% 
id="{{post300.nuevoInvisible}}" style="display:none; border-bottom:solid 
1px #C0C0C0;">
                                    <tr>
                                        <td 
width=50%><b>Título:</b><br><form><input ng-model="tt" type="text" 
class="form-control" placeholder="{{post300.tituloVacante}}"><button 
ng-click="mandar300()">Cambiar titulo</button></form></td>
                                        <td 
width=50%>&nbsp;&nbsp;<b>Empresa: </b>{{post300.idEmpresa}}</td>
                                    </tr>
                                </table>
                                
                            </div>
                        </div>
                    </div>
                </div>




and this is the controller:



var app = angular.module('uniApp',[]);


app.controller("mc300",function($scope,$http){

    $scope.mandar300=function(){
        alert($scope.tt);
        //$http.post("../c/insert2.php", {'Titulo':$scope.nombreyapellido}) 
.success(function(data,status,headers,config){ console.log("datos 
insertados correctamente"); });
        

    };


    
    $scope.invisibleBond = function(a,b){
        var detailesA = document.getElementById(a);
        var detailesB = document.getElementById(b);
        var details2 = detailesB.style.display;
        var details3 = "none";
        if (details2 == details3){detailesB.style.display = "block"; 
detailesA.style.display = "none";}
        var details5 = "block";
        if (details2 == details5){detailesB.style.display = "none"; 
detailesA.style.display = "block";}
    };

$scope.posts300 = [];
        $http.get("../m/i400.php")
        .success(function(data){
            console.log(data);
            $scope.posts300 = data;

        })
        .error(function(err){

        });  

});





Thanks in advance!



-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to