Angular Url Provider和mmenu不能一起使用

时间:2016-06-29 16:12:11

标签: javascript angularjs ngroute mmenu

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

应用代码:

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

1 个答案:

答案 0 :(得分:0)

对不起菜单代码并且没有在布局页面中显示。当我搬家时,它突然开始起作用了。