problem with angularjs #196

Open
chenminhua opened this Issue Mar 20, 2016 · 1 comment

Projects

None yet

2 participants

@chenminhua

I tried to use this plugin with angularjs.
But when I use "ng-if", this plugin does't work for me.
I guess it's not this plugin's problem. It's should be some wrong with ng-if.
I still can't mark it work.
please help me, thx.

HERE IS MY CODE SNIPPET. (in the controller's scope, we have a "login" variable to check if the user has logged in)

<body ng-app="app">
    <div ng-controller="NavigationCtrl">
        <div id="navigation" role="navigation" class="nav-collapse">
            <ul ng-if="login">
                <li><a href="/#/">HOME</a></li>
                <li><a href="/" ng-click="logOut()">LOGOUT</a></li>
                <li><a href="/#/snippet/create">CREATE</a></li>
                <li><a href=""> PROFIRE </a></li>
            </ul>
            <ul ng-if="!login">
                <li><a href="/#/user/signin">LOGIN</a></li>
                <li><a href="/#/user/register">REGISTER</a></li>
                <li><a href="">ABOUT</a></li>
            </ul>
        </div>
        <div class="main" role="main">
            <a href="#nav" class="nav-toggle">MENU</a>
            <div ng-view></div>
        </div>
    </div>
    <script src="./public/responsive-nav.js-master/responsive-nav.js"></script>
    <script src="./public/bower_components/jquery/dist/jquery.min.js"></script>
    <script>
        var navigation = responsiveNav("navigation",{customToggle: ".nav-toggle"})
    </script>
</body>
@yuens1002

hi there. i'm also interested in trying this so i read up on some instructions about this plugin. According to the instructions, it says to include

<script src="./public/responsive-nav.js-master/responsive-nav.js"></script>
<link rel="stylesheet" href="responsive-nav.css">

within the <head></head> tag. Is it possible this may be causing the issue with ng-if?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment