New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic parent #32
Comments
I want to add that I have tested the ncyBreadcrumbParent property and I could make it work with that but from what I see ncyBreadcrumbParent is static and I can not change it dynamically so I end up having two write two states instead of one. Any ideas? |
Hi, Since I started the project, I always had in mind that the breadcrumb is based on states and not on the browsing history. So the answer is no, it is not possible in the current version. Nevertheless, you point an interesting fact : the property
In the function, you will be able to add every logic you want to define the parent of the state. What do you think of it ? |
Hi, I think having the possibility to add a function that receives the current scope for the current state would be great. That way you can check something on the scope and decide whether to use one parent or the other. What do you think? |
I can inject a scope in the function, it will be the scope who emit the Dev in progress. |
…unction The `ncyBreadcrumb.parent` property can be a string containing a state name of a function returning a state name : ``` $stateProvider.state('B', { url:'/b', ncyBreadcrumb: { label: 'State B', parent: 'B' } }) ``` or ``` $stateProvider.state('B', { url:'/b', ncyBreadcrumb: { label: 'State B', parent: function() { return 'B'; } } }) ``` The function can have a $scope argument : it will be called with the same scope used by interpolation in labels: ``` $stateProvider.state('B', { url:'/b', ncyBreadcrumb: { label: 'State B', parent: function($scope) { return $scope.parentStateName; } } }) ``` Closes #32
Done ! @agustinjlopez & @divyamohan you can visualize the progression of version 0.3.0 here. Pending the release, you can download the 0.3.0 branch with bower by doing this:
|
I am opening this because I really don't know if it's possible or not. If it is, I think it is not documented. I have a state that can be reached from two different locations and I would like that the breadcrumb let's you go back to the location were you were at that moment.
Is this possible? I have been trying different stuff but could not make it yet.
The text was updated successfully, but these errors were encountered: