Join the Stack Overflow Community
Stack Overflow is a community of 6.5 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up
     row inside the historique function is an object from a table rendering machines so its an object
(function() {

  "use strict";

  angular
    .module('ngClassifieds')
    .controller('machineController', function($scope, $http,$state,$uibModal, $stateParams, MachineFactory) {
      var vm = this;
   vm.Historique=Historique;
   vm.Details=Details;

    vm.loggedU=$http.get('/getLogedUser');
      function Historique(row){
          vm.classified = row;
          $uibModal.open({
              animation: $scope.animationsEnabled,
              templateUrl: 'js/controllers/Machine/machine.historique.tpl.html',
              controller: 'machineHistController as vm',
              size:"lg",
              resolve: {
                    classified: function() {


                      return vm.classified;
                    }
                  }

          });

      }

**and in the modal instance i m running a stored procedure in a delete button that deletes child row inside the instance modal so when i click delete i wanna clear the row (it works only with refresh all the page so it runs good in the backend but in the front end it needs a refresh ) **check the picture here pls

**my html code **

<table class="table">
    <thead class="thead-inverse">
        <tr>

            <th><b>Nom logiciel</b></th>
            <th><b>Date Installation</b></th>

        </tr>
    </thead>
    <tbody>
        <tr ng-repeat="item in vm.logiciel.logiciels">

            <td>{{ item.nomL }}</td>
            <td>{{vm.logiciel.datelogicieli| date:"MM/dd/yyyy "}}</td>
            <td>
                <button ng-disabled="vm.loggedU.data.roles=='ROLE_DIRECTION'"
                    class="btn btn-alert" type="button"
                    ng-click="vm.deleteLogH(item.numL)">Delete</button>
            </td>
        </tr>

    </tbody>
</table>

and thats my intance modal controller

(function() { "use strict"; angular.module('ngClassifieds').controller( 

'machineHistController', function($scope, $http, $state, $uibModalInstance,

 $stateParams, classified, classifiedsFactory,$interval) {

            var vm = this;
            vm.cancel = cancel;
            vm.deleteLogH = deleteLogH;
            vm.deleteUitlisateurH = deleteUitlisateurH;
        vm.deletePerepheriqueH = deletePerepheriqueH;

        vm.type = [

        "OS", "LINUX", "Windows" ];

        vm.dateV = {
            currentDate : new Date()
        };


                vm.logiciel = classified;

                $scope.$watch('logiciel',function(value){

                    console.log("value="+value);
                });




        // ------------------------------

        function deleteLogH(numL) {
            vm.classifie = vm.logiciel;
            console.log(vm.classifie);
            vm.numL = numL;


            if(confirm("vous etes sur de cette action ??")){

                 var data = $.param({
                        numL: vm.numL,
                        numMachine:vm.classifie.numMachine

                    });

                    $http.delete('/DeleteL?' + data)
                    .success(function (data, status, headers) {
                       console.log("mchat serveur");

                    })
                    .error(function (data, status, header, config) {
                       console.log(data);
                    });

                    $state.reload();

            }

        }

i think that the solution is to refresh the object in the resolver of historique function but how to do anny help pls !!!!

share|improve this question
    
aaaaaaaany heeeelp here – Zammel AlaaEddine Sep 24 at 7:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.