Hi,
I am using angular ui router like following:
angular
.module('app', [
'ui.router'
])
.config(['$urlRouterProvider', '$stateProvider', function(
$urlRouterProvider, $stateProvider) {
$urlRouterProvider.otherwise('/');
$stateProvider
.state('start', {
url: '/',
templateUrl: 'templates/start.html',
controller: 'startCtrl'
})
.state('dictionary', {
url: '/dictionary',
templateUrl: 'templates/dictionary.html',
controller: 'dictionaryCtrl'
})
}])
This works just fine.
Now what I would like to do is to continue building the URL from
/dictionary.
Basically the dictionary will contain a repeated set of li elements which
are rendered based on an array of objects.
Note that the array of objects are retrieved from a source which may
contain a different set of objects from time to time.
<ul>
<li ng-repeat="element in array">
{{element}}
</li>
</ul>
By clicking an element in the above list the controller will update the
array and re-render the above list based on childelements to corresponding
element in the source.
*Now to the problem:*
First I would like the url to be appended like;
* /dictionary/selectedelement*
If I then would hit back in my browser I wish to return to */dictionary*
and if I were to bookmark */dictionary/selectedelement* I wish to be able
to render the list based on that last url- part.
I would like to use the same controller if it is possible.
Hit me!
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.