1

After click event on this button (code below)

<button (click)="login()" routerLink="/dashboard" class="btn btn-primary 
primary-login">Login with Google</button>

I wanted to change text value in header h1 to for example dashboard

<h1 class="oap__header--title"  >Welcome in Organizer App</h1>

Below is TypeScript code

login() {
this.afAuth.auth.signInWithPopup(new firebase.auth.GoogleAuthProvider());
}

Is anyone knows how to achieve that ?? Probably this is really easy but I don't know how to start with this problem

1 Answer 1

1

Don't hardcode the string in your HTML, use a property of your component, like this:

<h1 class="oap__header--title">{{ myString }}</h1>

in the TS file you'll have:

myString: string = 'Welcome in Organizer App'
login() {
  this.myString = 'Dashboard'
  this.afAuth.auth.signInWithPopup(new firebase.auth.GoogleAuthProvider());
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.