James Munsch

Here is the code I put together to look at how $routeProvider works in angular 1.4.x ... There is a link to a plunker at the end of the page.


var app = angular.module('plunker', ['ngRoute']);

app.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
        $routeProvider
          .when('/hello/:idHere', {
            templateUrl: 'resolveView.html',
            controller: 'helloCtrl',
            resolve: {
              exclamVal: function(){
                return '!!!!!!!!!!'
              }
            }
          })
          .when('/default', {
            templateUrl: 'default.html',
            controller: 'defaultCtrl'
          })
          .when('/test', {
            controller: 'testCtrl',
            templateUrl: 'test.html'
          })
          .otherwise({ redirectTo: '/default' });
          $locationProvider.html5Mode(true);
    }]);
    
app.controller('MainCtrl', function($scope, $location, $routeParams) {
});
app.controller('testCtrl', function($scope, $routeParams) {
  console.log('hi')
});
app.controller('defaultCtrl', function($scope, $routeParams) {
  console.log('Inside defaultCtrl')
});

app.controller('helloCtrl', function($scope, exclamVal, $routeParams) {
  $scope.exclamVal = exclamVal;
  $scope.myVar = $routeParams.idHere;
});

Don't forget to include the libraries


    <script data-require="angular.js@1.4.3" data-semver="1.4.3" src="https://code.angularjs.org/1.4.3/angular.js"></s$
    <script data-require="angular-route@1.4.3" data-semver="1.4.3" src="https://code.angularjs.org/1.4.3/angular-rout$

And the plunker: Here.