Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export class LoginComponent {
- username: string;
- password: string;
- msg: string;
- constructor(private _router: Router) {
- console.log("in Login component constructor");
- }
- onSubmit() {
- Parse.User.logIn(this.username, this.password, {
- success: function(user) {
- this.gotoMain();
- }.bind(this),
- error: function(user, error) {
- // The login failed. Check error to see why.
- this.msg = error.message;
- }.bind(this)
- });
- }
- gotoMain() {
- console.log("gotoMain with user: " + this.username); // works fine
- this._router.navigate(['Main']);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement