1
votes

I am learning Meteor using angular and I am a bit stumped with this error.

In my folder structure:

client
|_ index.html
|_ main.html
|_ main.js 

main.html contains the template I want to show on the page. This is a simple-as-can-be template.

<div ng-controller="ClassListCtrl">
    test away big boy! 
</div>

in main.js I have the module set up:

import angular from 'angular';
import angularMeteor from 'angular-meteor';

angular.module('rpgGame', [
    angularMeteor
]).controller('ClassListCtrl', function($scope){
    'ngInject';
});

and in index.html - I load the app, switch on ng-strict-di and include main.html as the source of a div using the ng-include directive:

<body ng-app="rpgGame" ng-strict-di="">
    <div ng-include src="'client/main.html'"></div>
</body>

however, as I mentioned in the title, I get

10 $digest() iterations reached. Aborting

Now - I haven't modified the scope in any way, thus I cannot see why angular will call digest updates - let alone that I haven't even iterated through a collection nor changed any collections. Why would this error be thrown?

from my console:

Watchers fired in the last 5 iterations: [[{"msg":"fn: constantWatch","newVal":"client/main.html"}],[{"msg":"fn: constantWatch","newVal":"client/main.html"}],[{"msg":"fn: constantWatch","newVal":"client/main.html"}],[{"msg":"fn: constantWatch","newVal":"client/main.html"}],[{"msg":"fn: constantWatch","newVal":"client/main.html"}]]
1
it must be with the library not with your code, it seems fine. whats this doing ng-strict-di="" ?Jorawar Singh
ng-strict-di directive is in place incase there is a minification problem. If there is a minification problem, it would be detected in development phase and and not only in production. see www.angular-meteor.com/tutorials/socially/angular1/dynamic-templateEon
I followed their instructions to the tee - but also renamed my controllers/collections ... it didn't worked. I dumbed it down to the version asked in the question - still throws the error there. Restarted meteor. Even Reinstalled all my packagesEon
is your code on git?Jorawar Singh
no - this is something I picked up yesterday. it's local-only nowEon

1 Answers

1
votes

It's not your code it's the library. If you print angularMeteor you can see its not an module.