title: Why Is My Main Controller Being Called Twice?
body: <p>All other routings are fine, but for some reason the main controller is being called twice. Why would this happen?</p>
  
  <pre class="lang-js prettyprint-override"><code>onInit: function() {
    var oRouter = this.getOwnerComponent().getRouter();
    oRouter.getRoute("main").attachMatched(this._onRouteMatched, this);
    this.getView().setModel(new JSONModel({
      Jobs: []
    }), "job");
  },
  </code></pre>
  
  <p>Is this down to the routing config?</p>
  
  <pre class="lang-json prettyprint-override"><code>"rootView": {
    "viewName": "CompleteSurvey.view.Main",
    "type": "XML"
  },
  "routing": {
    "routes": [{
      "name": "main",
      "pattern": "",
      "target": ["main"]
    }],
    "config": {
      "routerClass": "sap.m.routing.Router",
      "viewType": "XML",
      "viewPath": "CompleteSurvey.view",
      "controlId": "app",
      "controlAggregation": "pages"
    },
    "targets": {
      "main": {
        "viewName": "Main"
      }
    }
  }
  </code></pre>