angular2 router.navigate inside auth0 callback
<p>I am having an issue rendering a template after calling router.navigate inside a callback for auth0lock</p>

<p>loginComponent.ts</p>

<pre><code>import {Component, Inject} from 'angular2/core';
import {Router, ComponentInstruction} from 'angular2/router';

import {Auth} from '../auth';

declare var Auth0Lock;

@Component({
    selector: 'login',
    templateUrl: '/tpls/login/login.html'
})

export class LoginComponent {

    private lock = new Auth0Lock('xxx', 'xxx.auth0.com');

    constructor(@Inject(Router) private router: Router, @Inject(Auth) private auth: Auth) { }

    logError = (err) =&gt; {
        console.log(err);
    }

    loginSuccess = (data) =&gt; {
        if(this.router.parent.lastNavigationAttempt !== undefined &amp;&amp; this.router.parent.lastNavigationAttempt !== '/Login') {
            this.router.navigateByUrl(this.router.parent.lastNavigationAttempt);
        } else if(data.user.req_update) {
            this.router.navigate(['Profile']);
        } else {
            this.router.navigate(['Home']);
        }
    }

    ngOnInit() {

        this.lock.show((err: Error, profile: any, id_token: string) =&gt; {
            if(err) return this.logError(err);
            return this.auth.login(profile, id_token);
        }); 

        this.auth.loginSuccess.subscribe(
            data =&gt; this.loginSuccess(data),
            err =&gt; this.logError(err)
        );

    }
}
</code></pre>

<p>auth.ts</p>

<pre><code>import {Injectable, Inject, EventEmitter, Output } from 'angular2/core';
import {Http, Headers} from 'angular2/http';

@Injectable()

export class Auth {
    ...
    @Output() loginSuccess = new EventEmitter();

    login = (profile, id_token) =&gt; {
        ...

        this.addUser(profile).subscribe(
            data =&gt; {
                this.loginSuccess.next(data.json());
            },
            err =&gt; {
                console.log(err); 
                this.loginSuccess.error(err.json());
            }
        );
    }
    addUser = (user: any) =&gt; {
        let body = JSON.stringify(user);
        return this.http.post('/api/user/add', body, { headers: this.headers});
    }
}
</code></pre>

<p>homeComponent.ts</p>

<pre><code>import {Component, Inject, OnInit} from 'angular2/core';
import {Http} from 'angular2/http';
import {ROUTER_DIRECTIVES} from 'angular2/router'

import {Auth} from '../auth';
import {Post} from '../post/Post';
import {IPost} from '../post/IPost';
import {AuthorComponent} from '../author/authorComponent';

@Component({
    selector: 'home',
    templateUrl: '/tpls/home/home.html',
    directives: [ROUTER_DIRECTIVES, AuthorComponent]
})

export class HomeComponent implements OnInit {

    private postService: Post;
    private posts: IPost[];

    constructor(@Inject(Http) private http: Http, @Inject(Auth) private auth: Auth) {
        console.log('constructor');
        this.postService = new Post(this.http, this.auth);
        this.getPosts();
    }

    getPosts = () =&gt; {
        this.postService.all().subscribe(
            data =&gt; this.getPostsCallback(data.json()),
            err =&gt; this.logError(err)
        );
    }

    getPostsCallback = (data) =&gt; {
        console.log('callback');
        this.posts = data;
    }

    logError = (err) =&gt; {
        console.log(err);
    }

    ngOnInit() {
        console.log('init');
        //this.postService = new Post(this.http, this.auth);
        //this.getPosts();
    }

}
</code></pre>

<p>I am including the cdn script for authlock in my index page. Seems like any route I navigate to after login does not render. The callback from this.lock.show works and I can read the variables. Any advice is greatly appreciated.</p>

<p>basic concept: <a href="https://plnkr.co/edit/Oz8lY7v6q8GpH71WLtAK" rel="nofollow">https://plnkr.co/edit/Oz8lY7v6q8GpH71WLtAK</a></p>