ng-click not working in ng-repeat


NG-click not firing in ng -repeat. I want to use ngclick to display only the specific element details.

<body ng-app="mainApp" >
     <div ng-app = "mainApp" class="container" ng-controller="TableFilterController">
    <table ng-app = "mainApp" class ="table table-hover"> 
        <tr ng-repeat="p in details "><td>{{ $index + 1 }}</td><td><a  ng-click="clickMe()">{{}}</a></td><td>{{p.age}}</td><td>{{p.mass}}</td></tr>



var mainApp= angular.module("mainApp", []);

    mainApp.controller('TableFilterController', function($scope) {
    $scope.clickMe = function(){


There can be different-2 scenarios:
1. Remove Duplicate ng-app.

2.Use This Once,this will test if controller is calling onload or not

   mainApp.controller('TableFilterController', function($scope) {
   alert("its Calling");
 $scope.clickMe = function(){
  1. Check you have mentioned controller name in routing.
    4.Check your file’s code is loading in browser.

Check these points on first priority otherwise try to create plunker so that everyone can look into your code.

Answered By – RITESH ARORA

Answer Checked By – Willingham (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.