Skip to content

Commit 9298a5d

Browse files
committed
Added everything for Step 17: Listen to Matched Events of Any Route
1 parent e3cd6e4 commit 9298a5d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

webapp/controller/App.controller.js

+6
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ sap.ui.define([
2121
// telling what resource the user tried to access...
2222
Log.info("Sorry, but the hash '" + sHash + "' is invalid.", "The resource was not found.");
2323
});
24+
oRouter.attachRouteMatched(function (oEvent){
25+
var sRouteName = oEvent.getParameter("name");
26+
// do something, i.e. send usage statistics to back end
27+
// in order to improve our app and the user experience (Build-Measure-Learn cycle)
28+
Log.info("User accessed route " + sRouteName + ", timestamp = " + new Date().getTime());
29+
});
2430
}
2531
});
2632
});

0 commit comments

Comments
 (0)