Adding functionality of controllers to certain view In Angular
<p>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. </p>

<pre><code>&lt;div class="" ng-repeat="group in groups"&gt;
        &lt;h2 ng-bind="group.title"&gt;&lt;/h2&gt;
        &lt;div class="" ng-repeat="section in group.sections"&gt;
            &lt;div class="" ng-repeat="field in section.fields"&gt;

                &lt;!-- textfield --&gt;
                &lt;div class="form-group" ng-class="{ 'has-error': form.$submitted &amp;&amp; form[field.id].$invalid }" ng-if="field.type === 'text'"&gt;
                    &lt;!-- &lt;label for="{{field.id}}"&gt;{{field.title.substr(field.title.indexOf('.') + 2)}}&lt;/label&gt;&lt;br&gt; --&gt;
                    &lt;label for="{{field.id}}"&gt;{{field.title}}&lt;/label&gt;
                    &lt;br&gt;
                    &lt;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"&gt;
                    &lt;p class="form-group-note" ng-if="field.info" ng-bind="field.info"&gt;&lt;/p&gt;

                    &lt;div ng-show="form.$submitted" ng-cloack&gt;
                        &lt;span class="help-block" ng-show="form['{{field.id}}'].$error.required" ng-if="field.validations.required"&gt;Please enter a value, this field is required&lt;/span&gt;
                        &lt;span class="help-block" ng-show="form['{{field.id}}'].$error.minlength" ng-if="field.validations.min_length"&gt;Please enter a value of at least {{field.validations.min_length}} characters&lt;/span&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
     &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p></p>

<p>Ana I have <code>MainController.js</code> which has functionality of saving users' input in localstorage in realtime. However, it seems like my <code>129.html</code> is not recognizing that maincontroller.How can I add this to the view? I've seen something like <code>ng-controller=MainController</code> but i'm not sure whether this is correct.</p>