auth0-blog / angular2-authentication-sample

This is a sample that shows how to add authentication to an Angular 2 (ng2) app
MIT License
966 stars 334 forks source link

Exception when pipe is added #41

Open frankbenoit opened 8 years ago

frankbenoit commented 8 years ago

Hi please have a look at these modifcations: https://github.com/frankbenoit/angular2-authentication-sample/commit/5910ed3f19a45a84e338463ac1a5cee0fc97f477

I don't know if this is a problem in my pipe usage, in the auth sample code, or in angular2?!

I added a list of text item and a pipe to 'home'.

Good cases:

  1. If logged in, home can be opened normally.
  2. Before having the pipe, when not logged in; opening 'home' directly, the routeroutlet navigates to 'login'.

Now the bad case: Now with the pipe, not logged in and opening 'home' directly, an exception happens and the app crashes

Can you help?

frankbenoit commented 8 years ago

to change between good case and bad case, just change in home.html the line 15:

<li *ngFor="#item of items          ">{{item}}</li>
<li *ngFor="#item of items | orderBy">{{item}}</li>
tobika commented 8 years ago

Hi, I also work on a testing project where I added angular2-jwt. I have the exactly the same error like @frankbenoit

Tried to add pipe import in several places to see if it changes behaviour. Still the error.

chenkie commented 8 years ago

Would you be able to post the stack trace here? What is the exception that is thrown? Thanks!