Skip to content

Commit

Permalink
Added everything for Step 17: Listen to Matched Events of Any Route
Browse files Browse the repository at this point in the history
  • Loading branch information
wridgeu committed Apr 10, 2020
1 parent e3cd6e4 commit 9298a5d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions webapp/controller/App.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ sap.ui.define([
// telling what resource the user tried to access...
Log.info("Sorry, but the hash '" + sHash + "' is invalid.", "The resource was not found.");
});
oRouter.attachRouteMatched(function (oEvent){
var sRouteName = oEvent.getParameter("name");
// do something, i.e. send usage statistics to back end
// in order to improve our app and the user experience (Build-Measure-Learn cycle)
Log.info("User accessed route " + sRouteName + ", timestamp = " + new Date().getTime());
});
}
});
});

0 comments on commit 9298a5d

Please sign in to comment.