{"action":"created","issue":{"url":"https://api.github.com/repos/hilios/angular-django-formsets/issues/2","labels_url":"https://api.github.com/repos/hilios/angular-django-formsets/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/hilios/angular-django-formsets/issues/2/comments","events_url":"https://api.github.com/repos/hilios/angular-django-formsets/issues/2/events","html_url":"https://github.com/hilios/angular-django-formsets/issues/2","id":55059617,"number":2,"title":"registerChild() gets called before setup()","user":{"login":"rasca","id":79235,"avatar_url":"https://avatars.githubusercontent.com/u/79235?v=3","gravatar_id":"","url":"https://api.github.com/users/rasca","html_url":"https://github.com/rasca","followers_url":"https://api.github.com/users/rasca/followers","following_url":"https://api.github.com/users/rasca/following{/other_user}","gists_url":"https://api.github.com/users/rasca/gists{/gist_id}","starred_url":"https://api.github.com/users/rasca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rasca/subscriptions","organizations_url":"https://api.github.com/users/rasca/orgs","repos_url":"https://api.github.com/users/rasca/repos","events_url":"https://api.github.com/users/rasca/events{/privacy}","received_events_url":"https://api.github.com/users/rasca/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-21T18:44:27Z","updated_at":"2015-03-24T21:41:37Z","closed_at":null,"body":"I don't know why this is happening, I've tried settings priorities in the directives but couldn't get it to work. This only happens when there is at least one pre existing form in the formset. When there are no forms it works fine.\r\n\r\nI'm using angularjs 1.3.8 and jquery 2.1.1\r\n\r\nThis is the error traceback:\r\n\r\n```\r\n\"Error: self.__totalforms__ is null\r\nself.update@http://127.0.0.1:8000/static/frontend/js/ngDjangoFormset/controllers.js:82:7\r\nself.registerChild@http://127.0.0.1:8000/static/frontend/js/ngDjangoFormset/controllers.js:127:7\r\npostLink@http://127.0.0.1:8000/static/frontend/js/ngDjangoFormset/directives.js:28:7\r\ninvokeLinkFn@http://127.0.0.1:8000/static/js/angularjs/angular.js:8213:9\r\nnodeLinkFn@http://127.0.0.1:8000/static/js/angularjs/angular.js:7722:1\r\ncompositeLinkFn@http://127.0.0.1:8000/static/js/angularjs/angular.js:7075:13\r\nnodeLinkFn@http://127.0.0.1:8000/static/js/angularjs/angular.js:7717:1\r\ncompositeLinkFn@http://127.0.0.1:8000/static/js/angularjs/angular.js:7075:13\r\nnodeLinkFn@http://127.0.0.1:8000/static/js/angularjs/angular.js:7717:1\r\ncompositeLinkFn@http://127.0.0.1:8000/static/js/angularjs/angular.js:7075:13\r\nnodeLinkFn@http://127.0.0.1:8000/static/js/angularjs/angular.js:7717:1\r\ncompositeLinkFn@http://127.0.0.1:8000/static/js/angularjs/angular.js:7075:13\r\npublicLinkFn@http://127.0.0.1:8000/static/js/angularjs/angular.js:6954:30\r\nbootstrapApply/<@http://127.0.0.1:8000/static/js/angularjs/angular.js:1451:11\r\n$RootScopeProvider/this.$get</Scope.prototype.$eval@http://127.0.0.1:8000/static/js/angularjs/angular.js:14383:16\r\n$RootScopeProvider/this.$get</Scope.prototype.$apply@http://127.0.0.1:8000/static/js/angularjs/angular.js:14482:18\r\nbootstrapApply@http://127.0.0.1:8000/static/js/angularjs/angular.js:1449:9\r\ninvoke@http://127.0.0.1:8000/static/js/angularjs/angular.js:4182:14\r\nbootstrap/doBootstrap@http://127.0.0.1:8000/static/js/angularjs/angular.js:1447:1\r\nbootstrap@http://127.0.0.1:8000/static/js/angularjs/angular.js:1467:1\r\nangularInit@http://127.0.0.1:8000/static/js/angularjs/angular.js:1361:5\r\n@http://127.0.0.1:8000/static/js/angularjs/angular.js:26065:5\r\nn.Callbacks/j@http://127.0.0.1:8000/static/js/jquery-2.1.1.min.js:2:26855\r\nn.Callbacks/k.fireWith@http://127.0.0.1:8000/static/js/jquery-2.1.1.min.js:2:27673\r\n.ready@http://127.0.0.1:8000/static/js/jquery-2.1.1.min.js:2:29465\r\nI@http://127.0.0.1:8000/static/js/jquery-2.1.1.min.js:2:29656\r\n\" \"<li formset-child=\"\" class=\"list-group-item ng-scope\">\"\r\n```\r\n\r\nThis is the template I'm using:\r\n\r\n```html\r\n    {% for formset in formsets %}\r\n    <div formset=\"formset-template-{{ formset.prefix }}.html\" formset-can-order=\"{{ formset.can_order }}\" formset-can-delete=\"{{ formset.can_delete }}\" formset-prefix=\"{{ formset.prefix }}\" class=\"panel panel-default\" id=\"fieldset-{{formset.prefix}}\">\r\n        {% if formset.title %}\r\n        <div class=\"panel-heading panel-toggle\" data-toggle=\"collapse\" data-target=\"#fieldset-{{formset.prefix}} .list-group, #fieldset-{{formset.prefix}} .panel-footer\">\r\n            <h3 class=\"panel-title\">\r\n                {{ formset.title|capfirst }}\r\n            </h3>\r\n        </div>\r\n        {% endif %}\r\n\r\n        {{ formset.management_form }}\r\n        <ul formset-container class=\"list-group collapse in\">\r\n\r\n            {% for form in formset %}\r\n            <li formset-child class=\"list-group-item\">\r\n                {% crispy form %}\r\n            </li>\r\n            {% endfor %}\r\n\r\n            <script type=\"text/ng-template\" id=\"formset-template-{{ formset.prefix}}.html\">\r\n                <li formset-child class=\"list-group-item\">\r\n                    {% crispy formset.empty_form %}\r\n                    <div class=\"form-group\">\r\n                        <div class=\"col-md-4 col-md-offset-2\">\r\n                            <button formset-remove type=\"button\" class=\"btn btn-default\">\r\n                                <span class=\"fa fa-remove\"> Eliminar</span>\r\n                            </button>\r\n                        </div>\r\n                    </div>\r\n                </li>\r\n            </script>\r\n        </ul>\r\n\r\n            <div class=\"panel-footer collapse in\">\r\n                <button formset-add type=\"button\" class=\"btn btn-default\">\r\n                    <span class=\"fa fa-plus\"> Agregar otro</span>\r\n                </button>\r\n            </div>\r\n    </div>\r\n    {% endfor %}\r\n```"},"comment":{"url":"https://api.github.com/repos/hilios/angular-django-formsets/issues/comments/85705482","html_url":"https://github.com/hilios/angular-django-formsets/issues/2#issuecomment-85705482","issue_url":"https://api.github.com/repos/hilios/angular-django-formsets/issues/2","id":85705482,"user":{"login":"rasca","id":79235,"avatar_url":"https://avatars.githubusercontent.com/u/79235?v=3","gravatar_id":"","url":"https://api.github.com/users/rasca","html_url":"https://github.com/rasca","followers_url":"https://api.github.com/users/rasca/followers","following_url":"https://api.github.com/users/rasca/following{/other_user}","gists_url":"https://api.github.com/users/rasca/gists{/gist_id}","starred_url":"https://api.github.com/users/rasca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rasca/subscriptions","organizations_url":"https://api.github.com/users/rasca/orgs","repos_url":"https://api.github.com/users/rasca/repos","events_url":"https://api.github.com/users/rasca/events{/privacy}","received_events_url":"https://api.github.com/users/rasca/received_events","type":"User","site_admin":false},"created_at":"2015-03-24T21:41:37Z","updated_at":"2015-03-24T21:41:37Z","body":"No, sorry, I ended up some custom js for the case I needed. If you find a solution please post it!"}}