Home:ALL Converter>angular js routing with parameters

angular js routing with parameters

Ask Time:2015-10-06T18:20:33         Author:refactor

Json Formatter

In the below mentioned angular code I am trying to use Angular js routing feature.

Below is the partial code related to routing

...........
...
TicketApp.config(function ($routeProvider) {
$routeProvider 

     // EXPECTING THIS ROUTE TO BE EXECUTED 
      .when('/EditTicket/:idx', {
        templateUrl: '../Ticket/EditTicket/',            
        controller: 'EditTicketCtrl'
    })

.otherwise({
    templateUrl: '../Account/AllUsers',
    controller: 'AllUsersCtrl'
});
.......
....

When user clicks a hyper link below function gets called

 $scope.Edit = function (idx) {

     $location.path('/EditTicket'/idx);     

};

When the above function gets executed instead of .when('/EditTicket/:idx'.. , the otherwise part is getting executed. Please let me know what needs to be changed so that the .when('/EditTicket/:idx' gets executed.

Author:refactor,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/32967506/angular-js-routing-with-parameters
yy