我正在尝试在网站上显示侧边栏菜单。但是,它没有出现。

应用程式码:

appModule.config([
'$stateProvider', '$urlRouterProvider',
function ($stateProvider, $urlRouterProvider) {

    // Default route (overrided below if user has permission)
    $urlRouterProvider.otherwise("/home");

    $stateProvider.state('home', {
        url: '/home',
        templateUrl: '~/App/common/views/home/index.cshtml',
        menu: 'Home'
    });}


html和js代码:

<script type="text/javascript" src="~/custom/js/jquery.mmenu.min.all.js"></script>

@* Below JS is for slide out menu *@

<script type="text/javascript">
    $(document).ready(function () {
        $("#menu").mmenu({
            "slidingSubmenus": false,
            "offCanvas": {
                "zposition": "front",
                "pageSelector": "#page"
            }
        });
    });
</script>

 <a href="#menu" class="navbar-brand">
                <button class="navbar-toggle" type="button">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
            </a>


 <nav id="menu">
    <ul>
       <li><a href="/application#/home">test</a></li>
    </ul>
  </nav>


这是我得到的网站:

http://mmenu.frebsite.nl/examples.html

最佳答案

抱歉,菜单代码不在布局页面中。当我搬家时,它突然开始工作。

关于javascript - Angular Url Provider和mmenu不能一起使用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/38104986/

10-12 15:17