seergiue
seergiue

Reputation: 326

JQuery .click() not working maybe interfering with angularJS

I have this code on my main page:

<body>
    <div id="leftMenu" ng-app=SearchApp>
    	<div id="searchFoldersList"><span class="icon-search search"></span><input ng-model="searchFolder" type="text" placeholder="Search..." /></div>
    	<div id="foldersList" ng-controller="empCtrl">
        	<ul>
                <li ng-repeat="fold in folder | filter: searchFolder">{{fold.Folder}} <div id="editFolder_menu"><span class="icon-edit"></span></div></li>
                <li ng-show="showInputBox = !showInputBox" id="addFolderInputBox"><input ng-model="fname" name="fname" class="changeNameFolder" placeholder="New folders name..." type="text" /></li>
            </ul>
        </div>
    	<div id="addFolderBox" ng-click="showInputBox"><span class="icon-add plus"></span> ADD NEW FOLDER</div>
    </div>
    <div id="rightContent">
        <div id="menuContent">
        	<ul>
            	<li><span class="icon-list"></span></li>
                <li><span class="icon-settings"></span></li>
                <li><span class="icon-account-circle"></span></li>
            </ul>
        </div>
    </div>
</body>

And this on scripts.js:

$(document).ready(function() {
	$("#foldersList ul li").click(function(){
	alert("HELLO");
		});
});

Any idea why this is not working?

I think its because something is interfering with angularJS.

Thanks!

Upvotes: 0

Views: 47

Answers (1)

ryansstack
ryansstack

Reputation: 1476

instead of do that, add ng-click="someFunc()" to your li elements and define that someFunc as a property of the empCtrl scope

Upvotes: 1

Related Questions