I have a view called 129.html and it's format is like following. It's basically bunch of questions which are reading from json file.
<div class="" ng-repeat="group in groups">
<h2 ng-bind="group.title"></h2>
<div class="" ng-repeat="section in group.sections">
<div class="" ng-repeat="field in section.fields">
<!-- textfield -->
<div class="form-group" ng-class="{ 'has-error': form.$submitted && form[field.id].$invalid }" ng-if="field.type === 'text'">
<!-- <label for="{{field.id}}">{{field.title.substr(field.title.indexOf('.') + 2)}}</label><br> -->
<label for="{{field.id}}">{{field.title}}</label>
<br>
<input type="text" class="form-control" id="{{field.id}}" name="{{field.id}}" ng-model="formData[field.id]" ng-required="field.validations.required" ng-minlength="field.validations.min_length">
<p class="form-group-note" ng-if="field.info" ng-bind="field.info"></p>
<div ng-show="form.$submitted" ng-cloack>
<span class="help-block" ng-show="form['{{field.id}}'].$error.required" ng-if="field.validations.required">Please enter a value, this field is required</span>
<span class="help-block" ng-show="form['{{field.id}}'].$error.minlength" ng-if="field.validations.min_length">Please enter a value of at least {{field.validations.min_length}} characters</span>
</div>
</div>
</div>
</div>
Ana I have MainController.js which has functionality of saving users' input in localstorage in realtime. However, it seems like my 129.html is not recognizing that maincontroller.How can I add this to the view? I've seen something like ng-controller=MainController but i'm not sure whether this is correct.