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

Add ncyStateParams property #85

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

davinci-studio
Copy link

Usage:

url: '/login/:userType',
ncyBreadcrumb: {
label: "{{ ncyStateParams.userType }}"
}

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling f28ce22 on davinci-studio:master into * on ncuillery:master*.

@@ -212,6 +216,7 @@ function BreadcrumbDirective($interpolate, $breadcrumb, $rootScope) {
scope.steps = $breadcrumb.getStatesChain();
angular.forEach(scope.steps, function (step) {
if (step.ncyBreadcrumb && step.ncyBreadcrumb.label) {
viewScope.ncyStateParams = $breadcrumb.getStateParams();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, many thanks for the PR.

I don't understand why you attach the stateParams to the viewScope here : it is the same scope of the one handled by the view controller (where you can already inject $stateParams and use it).

It make more sense if you attach the stateParams to the scope of the directive (scope) in order to use it in custom templates. Maybe, is that you wanted to do ?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forget an important part:

Before doing anything in your branch history, please can you revert changes on release/angular-breadcrumb.js and release/angular-breadcrumb.min.js ?

I change these file only when I made a new release (it allows users to always have a stable version when they checkout the master).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
I use translations in the breadcrumb label, eg. label: {{ 'breadcrumb.login.admin' | translate }} by changing the last part of my translation key from stateParams (admin/company/user). I had some troubles when I tried to inject the stateParams from controller scope and I was getting undefined in some cases.

Revert changes from release directory? If you would like to add this changes to the official repository, of course.

@stramel
Copy link

stramel commented Sep 2, 2016

Looks like this might be covered with #105 & #146 injecting $stateParams?

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

Successfully merging this pull request may close these issues.

None yet

4 participants