Skip to content

Instantly share code, notes, and snippets.

@jazdw
Created May 1, 2019 21:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jazdw/f06420239e4fa84fc5aa4a1edb6d01ee to your computer and use it in GitHub Desktop.
Save jazdw/f06420239e4fa84fc5aa4a1edb6d01ee to your computer and use it in GitHub Desktop.
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