7

I have problem with ng-click (I'm using angular 1.0.4). First ng-click works but second no.

    <div class="menu-group" ng-repeat="module in modules">
         <div ng-click="toggle($event, $parent)" class="group-head">{{module.group.name}} <span class="{{module.group.icon}}"></span></div>
         <ul class="menu collapsed" ng-init="items = module.group.items">
              <li ng-repeat="item in items" ng-click="openCategory($event, '{{item.name}}')">{{item.display}}</li>
         </ul>
    </div>

Generated code looks good:

    <li ng-repeat="item in items" ng-click="openCategory($event, 'simpleName')" class="ng-scope ng-binding">Simple name</li>
1
  • @mikel without this mark is the same. However if I remove {{item.name}} and type something it works Commented Jan 25, 2013 at 11:32

1 Answer 1

22

Instead of '{{item.name}}' just use item.name

Demo: http://plnkr.co/edit/QNKZDT9N5k2tQaRrFlwY?p=preview

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

Comments

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.