-
Notifications
You must be signed in to change notification settings - Fork 183
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
Doesn't work with Angular 1.6 components #172
Comments
See #170, you can use |
I thought noone was supposed to be using variables that start with double "$", like $$childHead, because they're private to Angular and may change at any time without notice. Am I wrong? |
I came here previously looking for a solution, but have since figured out a workaround for my specific usage and wanted to share it with the next person who comes here looking for help as well. Having the non-linear parent crumb is an important feature for my use case. For any route that needs a breadcrumb, create a parent state with a standard $scoped controller that Here is an example of my approach, I hope it can help someone var singleContent = {
bindings: {
data: '<',
$transition$: '='
},
templateUrl: 'app/components/contents/single-content/single-content.html',
controller: 'SingleContentController',
};
angular
.module('contents.module',)
.component('singleContent', singleContent)
.config(function ($stateProvider) {
$stateProvider
.state('contents.single', {
redirectTo:'contents.single.view',
// Leaves contents.single state as a view passthru for more children
template:'<div ui-view class="contents-single"></div>',
controller:function($scope, data, $transition$){
/*
set contentType like the value of non-linear parent crumb
contents.all.type, which also uses this parent/child.view setup
*/
$scope.contentType = $transition$.params().contentType;
$scope.contentName = data.name; // For this label
},
url: '/content/:contentType/:contentId',
params: {
contentId: null,
contentType: null
},
resolve : {
data: function(ContentsModuleAPIService, $transition$){
return ContentsModuleAPIService
.getSingleContent($transition$.params().contentId, 0)
}
},
ncyBreadcrumb: {
parent: 'contents.all.type',
label: '\"{{ contentName }}\"'
},
})
.state('contents.single.view', {
component: 'singleContent',
url: '',
ncyBreadcrumb: {
parent: 'contents.single',
label: 'Details'
},
})
}); |
Here's my component:
});
The breadcrumb on the webpage only says "Home page", it doesn't say "Alexander".
Will this be fixed?
Thanks.
The text was updated successfully, but these errors were encountered: