function loadPathways () {
                    var pathways = scope.target.reactome;
                    var reactomePathways = [];

                    // Get the new identifiers
                    var promises = [];

                    if (!pathways.length) {
                        scope.noPathways = true;
                    }

                    pathways.forEach(function (pathway) {
                        // new Reactome API
                        var p = $http.get('https://reactome.org/ContentService/data/query/' + pathway.id);
                        promises.push(p);
                    });
                    $q
                        .all(promises)
                        .then(function (vals) {
                            vals.forEach(function (val) {
                                if (val.data) {
                                    reactomePathways.push({
                                        'id': val.data.stId,
                                        'name': val.data.displayName
                                    });
                                }
                            });
                            // Remove the spinner
                            spDiv.parentNode.removeChild(spDiv);

                            scope.pathways = reactomePathways;
                            if (scope.pathways[0]) {
                                scope.setPathwayViewer(scope.pathways[0]);
                            }
                        });
                }
// Load all the pathways first:
Load all the pathways first.
Load all the pathways first .
function loadPathways () {
                    var pathways = scope.target.reactome;
                    var reactomePathways = [];
                    var promises = [];
                    if (!pathways.length) {
                        scope.noPathways = true;
                    }
                    pathways.forEach(function (pathway) {
                        var p = $http.get('https://reactome.org/ContentService/data/query/' + pathway.id);
                        promises.push(p);
                    });
                    $q
                        .all(promises)
                        .then(function (vals) {
                            vals.forEach(function (val) {
                                if (val.data) {
                                    reactomePathways.push({
                                        'id': val.data.stId,
                                        'name': val.data.displayName
                                    });
                                }
                            });
                            spDiv.parentNode.removeChild(spDiv);
                            scope.pathways = reactomePathways;
                            if (scope.pathways[0]) {
                                scope.setPathwayViewer(scope.pathways[0]);
                            }
                        });
                }
function loadPathways ( ) { var pathways = scope . target . reactome ; var reactomePathways = [ ] ; var promises = [ ] ; if ( ! pathways . length ) { scope . noPathways = true ; } pathways . forEach ( function ( pathway ) { var p = $http . get ( 'https://reactome.org/ContentService/data/query/' + pathway . id ) ; promises . push ( p ) ; } ) ; $q . all ( promises ) . then ( function ( vals ) { vals . forEach ( function ( val ) { if ( val . data ) { reactomePathways . push ( { 'id' : val . data . stId , 'name' : val . data . displayName } ) ; } } ) ; spDiv . parentNode . removeChild ( spDiv ) ; scope . pathways = reactomePathways ; if ( scope . pathways [ 0 ] ) { scope . setPathwayViewer ( scope . pathways [ 0 ] ) ; } } ) ; }
Load all the pathways first:
Load all the pathways first :
// Get the new identifiers // new Reactome API // Remove the spinner