routes - Don't change URL in AngularJS -
routes - Don't change URL in AngularJS -
i having 2 in html lets x , y. x contains list of objects , y shows "different views" filled relevant info related item clicked in x.
suppose if (lemon,orange etc) clicked showed properties "sourness" "weight" suppose if (wine,beer) clicked showed it's properties "alcohol%" etc.
since properties different created different views , passed parameters accordingly show apt data.
if not wrong utilize $routeprovider , have .config defined , pass parameters etc. "changes url" , , don't want that.
is possible wishing in angularjs?
p.s check link out , maintain eye on url select different names :)
what looking in config file.
you need ng-view, , templates. conditionally loading possible in angularjs via ? variable in url. can map $location.search() finding hash.
in essence, if loads lemon want them clicking on lemon add together conditional url website.com/fruit?v=lemon
$location.search() homecoming {"v":"lemon"}
using $location.search()["v"] allow retrieve string "lemon" , remap via config show "sourness/weight" html
function($routeprovider) { $routeprovider. when('?v=lemon', { templateurl: 'templates/lemon.html', controller: 'lemonctrl' }).
etc.
angularjs routes
Comments
Post a Comment