so trying implement routing in app. here sample jsfiddle of trying do: http://jsfiddle.net/georgiangelov/9yn3z/114/
so far working fine , moving through sections, routing changes , fine.
the problem following: when manually type section id in url bar local host : /section/s-3 redirected s-1 , page refreshes , loose of sections , roots have added far. works, , can switch between sections that, refreshes, , happens when click enter twice.
it's odd problem , not on how can debug it. actuall routing service.
app.config(function ($routeprovider) { $routeprovider .when('/', { redirectto: '/section/1', templateurl: '/tpl.html', }) .when('/section/:sectionid', { templateurl: '/tpl.html', }) .otherwise({ redirectto: '/' }); });
i tested app on chrome , on firefox. using chrome, if select url , type enter (without changing it) reloads page, hitting enter twice refresh page. using firefox, not happen, apparently don't have problem on ff (although user can press refresh button directly).
if refresh page, lose have inserted. need persist information want preserve between refreshes. if don't want send server, alternative use html5 local storage. can see example here:
Comments
Post a Comment