Advertisement
Guest User

Untitled

a guest
Apr 26th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. export class LoginComponent {
  2. username: string;
  3. password: string;
  4. msg: string;
  5.  
  6. constructor(private _router: Router) {
  7. console.log("in Login component constructor");
  8. }
  9.  
  10. onSubmit() {
  11. Parse.User.logIn(this.username, this.password, {
  12. success: function(user) {
  13. this.gotoMain();
  14. }.bind(this),
  15. error: function(user, error) {
  16. // The login failed. Check error to see why.
  17. this.msg = error.message;
  18. }.bind(this)
  19. });
  20. }
  21.  
  22. gotoMain() {
  23. console.log("gotoMain with user: " + this.username); // works fine
  24. this._router.navigate(['Main']);
  25. }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement