I have a button and a function in my ionic 4 Code. Ideally on the click of the button, the function should fire up but that's not happening.
MY HTML
<ion-content padding>
<div class="contentFlow" id="profile-content">
<h1>Profile</h1>
<ion-button (click)="clicked()" expand="block" color="light">
Logout
</ion-button>
</div>
</ion-content>
MY TS:
clicked() {
alert('hello');
}
Note: I need to keep the div in my code.
What should I do?
The back button navigates back in the app's history upon click. It is smart enough to know what to render based on the mode and when to show based on the navigation stack. To change what is displayed in the back button, use the text and icon properties.
First, create a Service folder inside the app folder and generate a service using command line. Go inside to the service folder and use this command to create a service called UserService. Now inside the UserService, you can call your LastFm APIs and get the response.
A color can be applied to an Ionic component in order to change the default colors using the color attribute. Notice in the buttons below that the text and background changes based on the color set. When there is no color set on the button it uses the primary color by default.
You can use [ngClass] for the same. Based on a global property (which is to be changed after click event) you can add the desired class to the button element.
I have seen such things when the rendering of elements is overlapping.
You should check. There maybe an invisible layer on top of the whole element. So you can see it but you cannot interact with it. Making us feel that the simple button press is not working.
Cheers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With