JavaScript $route.updateParams is not a function

I am trying to change the route Params in my controller using the updateParams method, but for some reason I am getting an error:

TypeError: $route.updateParams is not a function.

In my controller I have:

App.controller('AddController', ['$scope', '$routeParams', '$route',
function ($scope, $routeParams, $route)
{
    $route.updateParams({child: 'all'});
}]);

And this is my routing configuration:

App.config([
    '$routeProvider',
function ($routeProvider) {


    $routeProvider
        .when('/', {
            redirectTo: '/'
        })
        .when('/:page/:child*', {
            templateUrl: function($routeParams) {
                return 'views/'+ $routeParams.page + '/' + $routeParams.child + '.html';
            },
        })
        .otherwise({
            redirectTo: '/'
        });

}]);

I have no idea why can't I use the updateParams method, or what am I doing wrong here?

Answer:1

Here's my Mongoose schema: var DealSchema = new Schema({ deal:{ dealid:{ type: String, require: true, unique: true, }, title: String, ...

Here's my Mongoose schema: var DealSchema = new Schema({ deal:{ dealid:{ type: String, require: true, unique: true, }, title: String, ...

  1. insert document with id mongodb
  2. insert document with mongodb
  3. insert document with robomongo
  4. document insert in marklogic
  5. document insert in word
  6. insert document into word
  7. insert document into word as icon
  8. insert document into excel
  9. insert document into powerpoint
  10. insert document in excel
  11. insert document in powerpoint
  12. insert document into google docs
  13. insert document in word as icon
  14. insert document in elasticsearch
  15. insert document into google sheets
  16. insert document into mongodb
  17. insert document in ppt
  18. insert document into elasticsearch
  19. insert document in collection mongodb
  20. insert document into collection mongodb

I've been researching different client-side Javascript modules workflows for my current Node.JS Express project, and I am having trouble deciding between using Browserify + npm + gulp vs RequireJS + ...

I've been researching different client-side Javascript modules workflows for my current Node.JS Express project, and I am having trouble deciding between using Browserify + npm + gulp vs RequireJS + ...

  1. client side module
  2. typescript client side module
  3. client side validation module in drupal 7
  4. javascript client side module
  5. client side validation module in drupal 8
  6. client side import module

I am experimenting with a JavaScript library for working with big integers called BigInteger.js. Specifically, I am trying to print a big integer. However, I am getting puzzling results. For instance,...

I am experimenting with a JavaScript library for working with big integers called BigInteger.js. Specifically, I am trying to print a big integer. However, I am getting puzzling results. For instance,...

Here , In jquery I am trying to find previous 12 month date from given date. but, the previous 12 months dates are wrong. > var now = new Date(); > var months = new Array( "January", "...

Here , In jquery I am trying to find previous 12 month date from given date. but, the previous 12 months dates are wrong. > var now = new Date(); > var months = new Array( "January", "...

  1. jquery find previous sibling
  2. jquery find previous tr
  3. jquery find previous input
  4. jquery find previous element by tag
  5. jquery find previous td
  6. jquery find previous sibling with class
  7. jquery find previous element with class
  8. jquery find previous class
  9. jquery find previous div with class
  10. jquery find previous
  11. jquery find previous td with class
  12. jquery find previous element same level
  13. jquery find previous element with id
  14. jquery find previous tr with class
  15. jquery find previous span
  16. jquery find previous element of type
  17. jquery find previous label
  18. jquery find previous tag
  19. jquery find previous li
  20. jquery find previous row