Skip to content
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

Why href and not ui-sref #54

Closed
psi-4ward opened this issue Nov 5, 2014 · 12 comments
Closed

Why href and not ui-sref #54

psi-4ward opened this issue Nov 5, 2014 · 12 comments

Comments

@psi-4ward
Copy link

What is the reason to use href and not ui-sref within the templates? Leads to a page-reload for me.

@ncuillery
Copy link
Owner

I didn't think about that when I started designing the module :) I'm asking myself about include the refactoring the template in the next minor release (0.4.0). I keep the issue open.

Nevertheless, even with href, the page-reload is not expected. Can you provide more informations about it ?

  • Value of the href
  • html5mode or not ?
  • Versions of angular, ui-router and angular-breadcrumb
  • A plunker would be great (you can fork this one )

@psi-4ward
Copy link
Author

Ive updated to

ui-router: 0.2.13
angular: 1.3.8
angular-breadcrumb: 0.3.3

works as expected now without page-reload, thanks

decorating the template is also a easy solution

app.config(function($breadcrumbProvider) {
  $breadcrumbProvider.setOptions({
    template:
      '<div class="breadcrumb">' +
        '<a ng-repeat="step in steps" class="btn btn-flat" ui-sref="{{step.name}}" ng-disabled="$last">{{step.ncyBreadcrumbLabel}}</a>' +
      '</div>'
  });
});

@ncuillery
Copy link
Owner

I keep the issue open (to keep in mind the refactoring of the template).

Please, can you give me your old versions of dependencies ? (I would like to know if there is a general problem with a specific set of versions)

@ncuillery ncuillery reopened this Jan 5, 2015
@psi-4ward
Copy link
Author

Sorry to say but i dont have the old dep-list. This project was versioned after the update.

@ncuillery ncuillery removed the waiting label Jan 5, 2015
@stumpdk
Copy link

stumpdk commented Feb 26, 2015

It is still relevant to implement the use of ui-sref instead of href.
A manual change in the template as suggested by psi-4ward is possible, but only if static content is used.
A dynamic content parent as the example below isn't handled correct:

ncyBreadcrumb: {
parent: function($scope){ return 'show({id: ' + $scope.itemId+ '})'; },
label: 'Details'
}

Or am I missing something here?

@aragao-diego
Copy link

This still NOT working?!

ncyBreadcrumb: {
    parent: function($scope){ return 'show({id: ' + $scope.itemId+ '})'; },
    label: 'Details'
}

I have the same need!

@ncuillery
Copy link
Owner

That's because I DON'T have time to investigate and fix it. Fortunately, PR are welcome.

@aragao-diego
Copy link

Oh i see, make sense. Your work is great!
Keepgoing!

@kiddo13
Copy link
Contributor

kiddo13 commented Aug 21, 2015

@aragao-diego It's not working because the state.name is already parsed into state name without params. For example, passing "show({id: 3})" will be parsed as "show" as the step.name.

@ncuillery you could add conf.ncyBreadcrumbState = stateRef; inside $$addStateInChain function.
So, inside the template we could use ui-sref="{{ step.ncyBreadcrumbState }}" instead.

@kiddo13
Copy link
Contributor

kiddo13 commented Aug 21, 2015

I made a Pull Request for this. Hope you can review it.

kiddo13@5c2cabc

@AnirudhaGohokar
Copy link

@ncuillery Is the feature added by @kiddo13 merged with main branch?
Thank You.

@ncuillery
Copy link
Owner

@AnirudhaGohokar Yes 😄

The fix has been merged (release pretty soon) and I addressed the template enhancement in #142.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants