0

I got this error in inspector:

Error: [ngRepeat:dupes] http://errors.angularjs.org/1.2.9/ngRepeat/dupes?p0=subject%20in%20subjects&p1=string%3A%D0%90%D1%81%D1%82%D1%80%D0%BE%D0%BD%D0%BE%D0%BC%D0%B8%D1%8F
    at Error (<anonymous>)
    at http://vedomosti/js/angular.min.js:6:449
    at http://vedomosti/js/angular.min.js:184:445
    at Object.fn (http://vedomosti/js/angular.min.js:99:371)
    at h.$digest (http://vedomosti/js/angular.min.js:100:299)
    at h.$apply (http://vedomosti/js/angular.min.js:103:100)
    at f (http://vedomosti/js/angular.min.js:67:98)
    at E (http://vedomosti/js/angular.min.js:71:85)
    at XMLHttpRequest.v.onreadystatechange (http://vedomosti/js/angular.min.js:72:133) angular.min.js:84

But I don't understand where my mistake...

I'm writing an application for school. I have table school in MySQL. With fields: id, name, 1,2,3,4,5,6,7,8,9,10,11

1,2,3,4... it's classes and they are have information about subjects. Each class have their subjects. Now I'm writing part, in which user can set subjects into classes. 1 to 10 classes all works good. But when I click "load subjects from 11 class", I get this error.

This table with subjects:

div class="large-6 column">
                <label>Предметы {{class}} класса</label>
                <table>
                    <thead>
                    <tr>
                        <th style="width: 200px;">Предмет</th>
                        <th style="width: 200px;">Изменить</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="subject in subjects">
                        <td>{{subject}}</td>
                        <td><a>изменить</a></td>
                    </tr>
                    </tbody>
                </table>
            </div>

And button for load information other classes:

<button class="button success tiny" ng-click="getSCLASS()">получить</button>

And function for this button:

$scope.getSCLASS = function(){
        $http.post("/index.php/panel/getSCLASS", {class:$scope.class}).success(function(data){
            $scope.subjects = data;
            $scope.s_subjects = true;

        });
    }

From 1 to 10 classes - all works good. But with 11 class it's not work. I don't understand where my mistake.

Sorry for my English :|

1 Answer 1

2

See this and try this:

<div class="large-6 column">
    <label>Предметы {{class}} класса</label>
    <table>
        <thead>
        <tr>
            <th style="width: 200px;">Предмет</th>
            <th style="width: 200px;">Изменить</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="subject in subjects track by $index">
            <td>{{subject}}</td>
            <td><a>изменить</a></td>
        </tr>
        </tbody>
    </table>
</div>
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.