Ionic-framework: Ionic 2: Navigation with Angular 2 Router

Created on 20 Feb 2016  路  4Comments  路  Source: ionic-team/ionic-framework

Short description of the problem:

Can't seem to make nav work with Angular 2 Router. Is there a specific reason that this happens? I am creating a cross-platform app and getting the following error:

EXCEPTION: TypeError: Cannot read property 'componentType' of undefined

and the function that does give the error:

    value: function getPathRecognizerByComponent(componentType) {
    // given a componentType, figure out the best PathRecognizer to use
    var rules = this['_parentRouter'].registry._rules;
    var pathRecognizer = null;
    rules.forEach(function (rule) {
        pathRecognizer = rule.matchers.find(function (matcherPathRecognizer) {
            **return matcherPathRecognizer.handler**.componentType === componentType;
        });
    });
    return pathRecognizer;
}

It is fine when I comment out @RouteConfig.

Thanks

Most helpful comment

Can we still use angular 2 router module with in ionic 2 or is there alternative to this?

All 4 comments

Could you compare your code with the example here: https://github.com/driftyco/ionic/tree/2.0/ionic/components/nav/test/routing

Also, can you give some sample code for us to reproduce the problem?

Hello! Thanks for opening an issue with us! Since it has been a little while since there was any activity on this issue i will be closing it, but feel free to respond back if your still having the issue! Thanks again!

Can we still use angular 2 router module with in ionic 2 or is there alternative to this?

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aces-tm picture aces-tm  路  83Comments

wonderdogone picture wonderdogone  路  121Comments

vonovak picture vonovak  路  66Comments

dylanvdmerwe picture dylanvdmerwe  路  109Comments

marcovtwout picture marcovtwout  路  76Comments