I am attempting to retrieve URL parameters in my controller:
Although I came across this example, I encountered an error that appears to be connected to the loading of necessary modules.
app.controller('WidgetCtrl', ['$scope', '$routeParams', function ($scope, $routeParams, $http) {
var param1 = $routeParams.param1;
var param2 = $routeParams.param2;
var vm = $scope;
vm.data = "test";
}]);
Error:
Uncaught Error: [$injector:modulerr]
In my HTML file, I include:
<script src=".../angular-1.2.21/angular.min.js"></script>
<script src=".../angular-1.2.21/angular-route.min.js"></script>
How can I correctly access and utilize the URL parameters in my controller? What are the essential modules that should be loaded?