I am trying to create a Chrome extension for my school's Online Learning Platform. This website uses HashLocationStrategy, with multiple 'pages'.
I want to add custom ngRoutes to the page, so whenever it goes to the following URL: ".../magister/#/plus" it load my custom template into the ng-view component. I have tried the following script:
angular.module("MagisterPlusRouting", ["ngRoute"])
.controller("RootController", ($scope, $route, $routeParams, $location) => {
$scope.$route = $route;
$scope.$location = $location;
$scope.$routeParams = $routeParams;
})
.controller("PageController", ($scope, $routeParams) => {
})
.config(($routeProvider, $locationProvider) => {
$routeProvider.when("/plus", {
templateUrl: "index.html",
controller: "PageController",
});
$locationProvider.html5Mode(true);
});
But that does not seem to work, I get the following message in my console routechange undefined 0, this originates from the website's official script.
Is it even possible to do this? How do I add these new routes? If you need further information, tell me. Although I do not have access to the development source code of the website.