angular
    .module('ngSharepoint', [])
    .run(['$sp', '$spLoader', function($sp, $spLoader) {
        if ($sp.getAutoload()) {
            if ($sp.getConnectionMode() === 'JSOM') {
                $spLoader.loadScript('//ajax.aspnetcdn.com/ajax/4.0/1/MicrosoftAjax.js');
                $spLoader.loadScript('SP.Runtime.js');
                $spLoader.loadScript('SP.js');                    
            }else if ($sp.getConnectionMode() === 'REST' && !$sp.getAccessToken) {
            	$spLoader.loadScript('SP.RequestExecutor.js');
            }
        }
    }]);
angular
    .module('ngSharepoint', [])
    .run(['$sp', '$spLoader', function($sp, $spLoader) {
        if ($sp.getAutoload()) {
            if ($sp.getConnectionMode() === 'JSOM') {
                $spLoader.loadScripts('SP.Core', ['//ajax.aspnetcdn.com/ajax/4.0/1/MicrosoftAjax.js', 'SP.Runtime.js', 'SP.js']);                    
            }else if ($sp.getConnectionMode() === 'REST' && !$sp.getAccessToken) {
            	$spLoader.loadScript('SP.RequestExecutor.js');
            }
        }
    }]);
Load main JSOM Scripts under one label
Load main JSOM Scripts under one label
