0

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!

1
  • 1
    What might be happening is you're assigning the .click() before the elements are all created by the ng-repeat. Try assigning a ng-click handler in angular instead. Commented Jun 11, 2015 at 23:01

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

2 Comments

I had not thought about that, it's a great idea! Thank you so much.
One more thing, how can I add someFunc as a property of the empCtrl scope? Sorry im a newbie on AngularJS

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.