Your controller code should initializing the controller not the view.
The controller is initalised from inside the view
Ideally you would have your controller code in a separate folder in you project tree.
You code would the look like this
<core:View
controllerName="sap.ui.PageRoutingDemo.wt.controller.MainView"
xmlns:core="sap.ui.core"
xmlns="sap.m"
xmlns:mvc="sap.ui.core.mvc" >
<App xmlns="sap.m" id="rootControl"/>
</core:View>
sap.ui.define([
"sap/ui/core/mvc/Controller",
"sap/m/Page"
], function (Controller) {
"use strict";
return Controller.extend("sap.ui.PageRoutingDemo.wt.controller.MainView", {
onInit : function () {
}
});
});
regards
Chantele