angularjs - angular routing with optional parameter not working when refresh f5 -
angularjs - angular routing with optional parameter not working when refresh f5 -
i have angular routing:
$locationprovider.hashprefix("!").html5mode(true); $routeprovider .when('/', { templateurl: '/home/index', controller: 'homectrl' }) .when('/su-kien/:sename?', { templateurl: function (params) { homecoming typeof (params.sename) != "undefined" ? '/app/main/views/sukien/detail.html?sename=' + params.sename : '/app/main/views/sukien/index.html' }, controller: 'eventctrl' }) .when('/:pagename', { templateurl: '/app/main/views/common/index.html', controller: 'commonctrl' }) .otherwise({ redirectto: '/' });
i don't know why :pagename works fine f5 refresh page, /su-kien/:sename? works f5 reload works routing without paramter :sename
e.g:
/abc => /:pagename job /su-kien => works too, f5 ok /su-kien/aaaa=> work f5 doesn't
have nice weekend.
angularjs
Comments
Post a Comment