Created
May 1, 2019 21:40
-
-
Save jazdw/f06420239e4fa84fc5aa4a1edb6d01ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(['angular'], function(angular) { | |
'use strict'; | |
const userModule = angular.module('userModule', ['maUiApp']); | |
config.$inject = ['MA_UI_MENU_ITEMS']; | |
function config(MA_UI_MENU_ITEMS) { | |
const templateLocation = '/rest/v2/file-stores/default/'; | |
MA_UI_MENU_ITEMS | |
.filter(m => m.name.startsWith('ui.help.') || m.name.startsWith('ui.examples.')) | |
.forEach(m => { | |
delete m.templateProvider; | |
delete m.template; | |
if (m.resolve) { | |
delete m.resolve.viewTemplate; | |
} | |
const path = m.name.split('.'); | |
path.shift(); // remove ui | |
m.templateUrl = templateLocation + path.join('/') + '.html'; | |
}); | |
} | |
userModule.config(config); | |
return userModule; | |
}); // define |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment