Scott
Scott

Reputation: 175

Angular 2 pop up modal

I'm working in .net C# Angular 2 environment. I'm having issue with something that should be easy. Just trying to do a simple popup modal dialog box.

I can't see to put the html statement in verbatim and have the text in this message as i'd prefer, but I'll just state that I have a 'mat-raised-button' in the .html with "onclick = paymentDetails()"

and the corresponding typescript .ts file:

public paymentDetails() {
    console.log("changeFlagStatus");
}

Should be simple, in fact essentially same code exists all over the application. It's just when i add this new button i get the runtime error:

"Uncaught ReferenceError: paymentDetails is not defined at HTMLButtonElement.onclick (detail:1)"

Is there something special i need to do to add a new button into the mix?

Upvotes: 1

Views: 66

Answers (1)

Phil
Phil

Reputation: 7566

You trigger a method on click like this:

<mat-raised-button (click)="paymentDetails()></mat-raised-button'>

Upvotes: 1

Related Questions