Join the Stack Overflow Community
Stack Overflow is a community of 6.4 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

Below is my Angular Controller

Angular JS

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

multistage.controller('groupStanding', function($scope1) {
    $scope1.grouplimit = 3;
    $scope1.competitorDTL = <?php echo json_encode($competitorDtl); ?>;
    console.log($scope1.grouplimit);
});

and this is my html code below ...

HTML

    <tbody data-ng-controller="fixtureController">
        <tr data-ng-repeat="comp in competitorDTL">
        <td>
          <span class="badge" data-ng-if="$index+1 <= grouplimit">        
          {{$index+1}}</span> {{ comp.name}}
       </td>

    </tr>
    </tbody>

Its not working and i am unable to identify exactly what the problem is? If I replace grouplimit variable and put 3 directly there than its work fine.

share|improve this question
    
it should be multistage.grouplimit in the html. – Ceylan Mumun Kocabaş 2 days ago
    
Assuming you're using the right controller, give a shot to {{grouplimit}}. – Valberthe 2 days ago
    
Sir, multistage.grouplimit also not worked .. – user7192960 2 days ago
    
there is already another controller @Karim – user7192960 2 days ago
1  
@user7192960 partial is bound to diff. controller – balajisoundar 2 days ago
up vote 0 down vote accepted

Your controller name is 'groupStanding' and you have used data-ng-controller="fixtureController" change it to data-ng-controller="groupStanding"

share|improve this answer

You have missed '{' in {$index+1}}

<td><span class="badge" data-ng-if="$index+1 <= grouplimit">{$index+1}}</span>{{ comp.name}}

That could be the reason

share|improve this answer
    
This also not worked – user7192960 2 days ago
    
my array element is printing fine with the $scope1 variable then why do i need $scope in place of $scope1? – user7192960 2 days ago
    
Sorry, actually that i have mistaken here while writing the question . but the problem still exists. – user7192960 2 days ago

Try this :

{{groupelimit}}

groupelimit will then be replaced by its value in the corresponding controller.

share|improve this answer
    
No Its not work .. – user7192960 2 days ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.