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

Using Resolver in routes #2

Open
Parilar opened this issue Dec 3, 2017 · 1 comment
Open

Using Resolver in routes #2

Parilar opened this issue Dec 3, 2017 · 1 comment

Comments

@Parilar
Copy link

Parilar commented Dec 3, 2017

Hello, i've used this tutorial to get familar with AngularJs.
Breadcrumbs are working, except the part with the resolver.
How does a Resolver has to look for this lib? Already tried to use the Resolver from the repo but i still got the message that person is undefined.

I would be grateful for help

My Resolver (for testing)

    import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
    import { Injectable } from '@angular/core';
    import { IRecipe } from "../_class/person";

    @Injectable()
    export class PersonResolver implements Resolve<IRecipe> {

    constructor(private service: PersonService) { }

    public resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<IPerson> {

        const id = route.params.id;

        if (id) {
            return Promise.resolve({
                id: 900,
                title: "666666"
            });
        } else {
            return Promise.resolve({
                id: 0,
                title: ""
            });
        }
    }
    }
@dimamarksman
Copy link

I'm not sure but probably you should inherit from McBreadcrumbsResolver link

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

2 participants