File tree 1 file changed +23
-4
lines changed
1 file changed +23
-4
lines changed Original file line number Diff line number Diff line change 1
1
sap . ui . define ( [
2
- "com/mrb/UI5-Navigation-and-Routing/controller/BaseController"
3
- ] , function ( BaseController ) {
4
- "use strict" ;
2
+ "com/mrb/UI5-Navigation-and-Routing/controller/BaseController" ,
3
+ "sap/base/Log"
4
+ ] , function ( BaseController , Log ) {
5
+ "use strict" ;
5
6
6
- return BaseController . extend ( "com.mrb.UI5-Navigation-and-Routing.controller.App" , { } ) ;
7
+ return BaseController . extend ( "com.mrb.UI5-Navigation-and-Routing.controller.App" , {
8
+ onInit : function ( ) {
9
+ // This is ONLY for being used within the tutorial.
10
+ // The default log level of the current running environment may be higher than INFO,
11
+ // in order to see the debug info in the console, the log level needs to be explicitly
12
+ // set to INFO here.
13
+ // But for application development, the log level doesn't need to be set again in the code.
14
+ Log . setLevel ( Log . Level . INFO ) ;
15
+
16
+ var oRouter = this . getRouter ( ) ;
17
+
18
+ oRouter . attachBypassed ( function ( oEvent ) {
19
+ var sHash = oEvent . getParameter ( "hash" ) ;
20
+ // do something here, i.e. send logging data to the backend for analysis
21
+ // telling what resource the user tried to access...
22
+ Log . info ( "Sorry, but the hash '" + sHash + "' is invalid." , "The resource was not found." ) ;
23
+ } ) ;
24
+ }
25
+ } ) ;
7
26
} ) ;
You can’t perform that action at this time.
0 commit comments