templates/interface/js/ngapimock.controller.js
function fetchMocks() {
            mockService.get({}, function (response) {
                vm.mocks = response.mocks.map(function(mock){
                    Object.keys(mock.responses).forEach(function(response) {
                        mock.responses[response].name = response;
                    });
                    return mock;
                });
                vm.selections = response.selections;
                vm.delays = response.delays;
                vm.echos = response.echos;
                vm.recordings = response.recordings;
                vm.record = response.record;
                if (vm.record) {
                    interval = $interval(refreshMocks, 5000);
                }
            });
        }
function fetchMocks() {
            mockService.get({}, function (response) {
                vm.mocks = response.mocks.map(function(mock){
                    Object.keys(mock.responses).forEach(function(response) {
                        mock.responses[response].name = response;
                    });
                    return mock;
                });
                vm.selections = response.selections;
                vm.delays = response.delays;
                vm.echos = response.echos;
                vm.recordings = response.recordings;
                vm.record = response.record;
                if (vm.record) {
                    interval = $interval(refreshMocks, 5000);
                }
            });
        }
function fetchMocks ( ) { mockService . get ( { } , function ( response ) { vm . mocks = response . mocks . map ( function ( mock ) { Object . keys ( mock . responses ) . forEach ( function ( response ) { mock . responses [ response ] . name = response ; } ) ; return mock ; } ) ; vm . selections = response . selections ; vm . delays = response . delays ; vm . echos = response . echos ; vm . recordings = response . recordings ; vm . record = response . record ; if ( vm . record ) { interval = $interval ( refreshMocks , 5000 ) ; } } ) ; }
Fetch all the mocks and make them available.
Fetch all the mocks and make them available .