How to define optional parameter using UI-Router without trailing slash as well?
问题 I was working on migration of my Angularjs code from ng-router to UI-Router. In my ng-router I have optional parameters however I realized that same easy way to support optional parameter is not supported in ui-router. Following is my routes from my existing ng-router module. //Define routes for view using ng-router $routeProvider. when('/my-app/home/:userid?', { templateUrl: '/templates/partials/home/HomeView.html', controller: 'HomeViewController' }) .when('/my-app/:productKey/:userid?', {