generators/app/files.js
function addDropdownToMenu(dropdownName, routerName, glyphiconName, enableTranslation, clientFramework) {
    let navbarPath;
    try {
        if (clientFramework === 'angular1') {
            navbarPath = `${CLIENT_MAIN_SRC_DIR}app/layouts/navbar/navbar.html`;
            jhipsterUtils.rewriteFile({
                file: navbarPath,
                needle: 'jhipster-needle-add-element-to-menu',
                splicable: [ `<li ng-class="{active: vm.$state.includes('${dropdownName}')}" ng-switch-when="true" uib-dropdown class="dropdown pointer">
                    <a class="dropdown-toggle" uib-dropdown-toggle href="" id="${dropdownName}-menu">
                        <span>
                            <span class="glyphicon glyphicon-${glyphiconName}"></span>
                            <span class="hidden-sm" data-translate="global.menu.${dropdownName}.main">
                                ${dropdownName}
                            </span>
                            <b class="caret"></b>
                        </span>
                    </a>
                    <ul class="dropdown-menu" uib-dropdown-menu>
                        <li ui-sref-active="active">
                            <a ui-sref="${routerName}" ng-click="vm.collapseNavbar()">
                                <span class="glyphicon glyphicon-${glyphiconName}"></span>&nbsp;
                                <span${enableTranslation ? ` data-translate="global.menu.${routerName}"` : ''}>${_.startCase(routerName)}</span>
                            </a>
                        </li>
                        <!-- jhipster-needle-add-element-to-${dropdownName} - JHipster will add elements to the ${dropdownName} here -->
                    </ul>
                </li>`
                ]
            }, this);
        } else {
            navbarPath = `${CLIENT_MAIN_SRC_DIR}app/layouts/navbar/navbar.component.html`;
            jhipsterUtils.rewriteFile({
                file: navbarPath,
                needle: 'jhipster-needle-add-element-to-menu',
                splicable: [`<li *ngSwitchCase="true" ngbDropdown class="nav-item dropdown pointer">
                    <a class="nav-link dropdown-toggle" routerLinkActive="active" ngbDropdownToggle href="javascript:void(0);" id="${dropdownName}-menu">
                        <span>
                            <i class="fa fa-${glyphiconName}" aria-hidden="true"></i>
                            <span>${dropdownName}</span>
                        </span>
                    </a>
                    <ul class="dropdown-menu" ngbDropdownMenu>
                        <li>
                            <a class="dropdown-item" routerLink="${routerName}" routerLinkActive="active" [routerLinkActiveOptions]="{ exact: true }" (click)="collapseNavbar()">
                                <i class="fa fa-${glyphiconName}" aria-hidden="true"></i>&nbsp;
                                <span${enableTranslation ? ` jhiTranslate="global.menu.${routerName}"` : ''}>${_.startCase(routerName)}</span>
                            </a>
                        </li>
                        <!-- jhipster-needle-add-element-to-${dropdownName} - JHipster will add elements to the ${dropdownName} here -->
                    </ul>
                </li>`
                ]
            }, this);
        }
    } catch (e) {
        this.log(`${chalk.yellow('\nUnable to find ') + navbarPath + chalk.yellow(' or missing required jhipster-needle. Reference to ') + dropdownName} ${chalk.yellow('not added to menu.\n')}`);
        this.debug('Error:', e);
        this.log('Error:', e);
    }
}
function addDropdownToMenu(dropdownName, routerName, glyphiconName, enableTranslation, clientFramework) {
    let navbarPath;
    try {
        if (clientFramework === 'angular1') {
            navbarPath = `${CLIENT_MAIN_SRC_DIR}app/layouts/navbar/navbar.html`;
            jhipsterUtils.rewriteFile({
                file: navbarPath,
                needle: 'jhipster-needle-add-element-to-menu',
                splicable: [ `<li ng-class="{active: vm.$state.includes('${dropdownName}')}" ng-switch-when="true" uib-dropdown class="dropdown pointer">
                    <a class="dropdown-toggle" uib-dropdown-toggle href="" id="${dropdownName}-menu">
                        <span>
                            <span class="glyphicon glyphicon-${glyphiconName}"></span>
                            <span class="hidden-sm" data-translate="global.menu.${dropdownName}.main">
                                ${dropdownName}
                            </span>
                            <b class="caret"></b>
                        </span>
                    </a>
                    <ul class="dropdown-menu" uib-dropdown-menu>
                        <li ui-sref-active="active">
                            <a ui-sref="${routerName}" ng-click="vm.collapseNavbar()">
                                <span class="glyphicon glyphicon-${glyphiconName}"></span>&nbsp;
                                <span${enableTranslation ? ` data-translate="global.menu.${routerName}"` : ''}>${_.startCase(routerName)}</span>
                            </a>
                        </li>
                        <!-- jhipster-needle-add-element-to-${dropdownName} - JHipster will add elements to the ${dropdownName} here -->
                    </ul>
                </li>`
                ]
            }, this);
        } else {
            navbarPath = `${CLIENT_MAIN_SRC_DIR}app/layouts/navbar/navbar.component.html`;
            jhipsterUtils.rewriteFile({
                file: navbarPath,
                needle: 'jhipster-needle-add-element-to-menu',
                splicable: [`<li *ngSwitchCase="true" ngbDropdown class="nav-item dropdown pointer">
                    <a class="nav-link dropdown-toggle" routerLinkActive="active" ngbDropdownToggle href="javascript:void(0);" id="${dropdownName}-menu">
                        <span>
                            <i class="fa fa-${glyphiconName}" aria-hidden="true"></i>
                            <span>${dropdownName}</span>
                        </span>
                    </a>
                    <ul class="dropdown-menu" ngbDropdownMenu>
                        <li>
                            <a class="dropdown-item" routerLink="${routerName}" routerLinkActive="active" [routerLinkActiveOptions]="{ exact: true }" (click)="collapseNavbar()">
                                <i class="fa fa-${glyphiconName}" aria-hidden="true"></i>&nbsp;
                                <span${enableTranslation ? ` jhiTranslate="global.menu.${routerName}"` : ''}>${_.startCase(routerName)}</span>
                            </a>
                        </li>
                        <!-- jhipster-needle-add-element-to-${dropdownName} - JHipster will add elements to the ${dropdownName} here -->
                    </ul>
                </li>`
                ]
            }, this);
        }
    } catch (e) {
        this.log(`${chalk.yellow('\nUnable to find ') + navbarPath + chalk.yellow(' or missing required jhipster-needle. Reference to ') + dropdownName} ${chalk.yellow('not added to menu.\n')}`);
        this.debug('Error:', e);
        this.log('Error:', e);
    }
}
function addDropdownToMenu ( dropdownName , routerName , glyphiconName , enableTranslation , clientFramework ) { let navbarPath ; try { if ( clientFramework === 'angular1' ) { navbarPath = ` ${ CLIENT_MAIN_SRC_DIR } ` ; jhipsterUtils . rewriteFile ( { file : navbarPath , needle : 'jhipster-needle-add-element-to-menu' , splicable : [ ` ${ dropdownName } ${ dropdownName } ${ glyphiconName } ${ dropdownName } ${ dropdownName } ${ routerName } ${ glyphiconName } ${ enableTranslation ? ` ${ routerName } ` : '' } ${ _ . startCase ( routerName ) } ${ dropdownName } ${ dropdownName } ` ] } , this ) ; } else { navbarPath = ` ${ CLIENT_MAIN_SRC_DIR } ` ; jhipsterUtils . rewriteFile ( { file : navbarPath , needle : 'jhipster-needle-add-element-to-menu' , splicable : [ ` ${ dropdownName } ${ glyphiconName } ${ dropdownName } ${ routerName } ${ glyphiconName } ${ enableTranslation ? ` ${ routerName } ` : '' } ${ _ . startCase ( routerName ) } ${ dropdownName } ${ dropdownName } ` ] } , this ) ; } } catch ( e ) { this . log ( ` ${ chalk . yellow ( '\nUnable to find ' ) + navbarPath + chalk . yellow ( ' or missing required jhipster-needle. Reference to ' ) + dropdownName } ${ chalk . yellow ( 'not added to menu.\n' ) } ` ) ; this . debug ( 'Error:' , e ) ; this . log ( 'Error:' , e ) ; } }
Add a new dropdown element, at the root of the menu.

@param {string} dropdownName - The name of the AngularJS router that is added to the menu.
@param {string} glyphiconName - The name of the Glyphicon (from Bootstrap) that will be displayed.
@param {boolean} enableTranslation - If translations are enabled or not
@param {string} clientFramework - The name of the client framework
Add a new dropdown element at the root of the menu .