Let's say I have a button with onClick attribute set to doSomeThings(someId)
When I inspect it on Chrome or Safari it shows:
<button onclick="doSomeThings("1")" type="button"> </button>
Now I use the Chrome / Safari inspector and change the 1 to, let's say, 3, and press enter. I don't get
<button onclick="doSomeThings("3")" type="button"> </button>
but
<button onclick="doSomeThings(" type="button"> </button>
Is it some security feature or am I doing something wrong ?
Related
I am trying to get the button href from material-ui.com to open in an external self window if the link is external.
Wondering how this can be done.
<Button size="small" color="primary" href="https://example.com/" target="self">
Visit Website
</Button>
Normally we would code
link
Instead of Button, maybe you could try using Link component instead https://material-ui.com/components/links/
<Link
component="button"
variant="body2"
onClick={() => {
console.info("I'm a button.");
}}
>
Button Link
</Link>
using ionic 3.9.2
Objective:
back button in navbar using ios-arrow-back style and "back" with translate pipe
with setBackButtonText(), manage to set back button text.
But it's tedious to do it for every page with getting reference of nav bar, set text after view init.
Any way to set back button text in template in which can set it like {{ 'back' | translate }}
How to use other icon for back button?
first try: ion-nav-back-button, prompt ion-nav-back-button not known
second try:
<ion-buttons start>
<button ion-button>
<ion-icon name="ios-arrow-back"></ion-icon>
<p>back</p>
</button>
</ion-buttons>
However, it's strange that even with start, the button is on right end.
Playground:
ionic playground
hope to see advice, thanks
Try this. Works well on android and ios
<ion-buttons left>
<button ion-button (click)="dismiss()">
<span ion-text color="primary" showWhen="ios">Back</span>
</button>
<button ion-button (click)="dismiss()">
<ion-icon name="arrow-round-back" showWhen="android,windows"></ion-icon>
</button>
</ion-buttons>
When I click the ionic navigation back button, app skip the immediate back page and redirected to the first page (ie. When click back from page5, it skip page4 and redirected to page3).
I also tried a manual back by writing a function but the result was same.
How can I resolve this?Please help...
My code
1.View
<div class="bar bar-header nav_header">
<button class="button icon ion-arrow-left-b button-clear btn-sm nav_headeritems" ng-click="backstate()">Go Back</button>
<h1 class="title nav_headeritems">Profile</h1>
</div>
2.Controller
$scope.backstate =function(){
$ionicHistory.goBack(-1);
//alert("back");
}
I'm trying to click on a button using protractor.
My HTML looks like this:
<button class="_btn--block _btn _btn--primary" ng-transclude="" sw-type="submit" swed-busy-click="" sw-priority="primary" type="submit">
<span>
Continue
</span>
</button>
I have tried using this but it didn't work:
element($('button[name="Continue"]')).click();
element(by.partialButtonText("Cont")).click()
element($('button[name="Continue"]')).click(); this is not a correct css since name of the button is not available COntinue is the text
You could try
element($('button[sw-type="submit"][class^="btn--block _btn"]')).click()
How can I disable a button inside ion-nav-buttons depending on an action in the ion-content?
example: if I click in a button inside ion-content the button inside
ion-nav-buttons get disabled.
As I see, I canĀ“t controll the elements inside ion-nav-buttons from the controller of the template that has the ion-nav-buttons.
This can be done with ng-disabled in button
Check this Try ng-disabled
<ion-view>
<ion-nav-buttons side="primary">
<button class="button" ng-disabled="disabled" ng-click="doSomething()">
I'm a button on the primary of the navbar!
</button>
</ion-nav-buttons>
<ion-content>
<button class="button" ng-click="disable()">
Click to disable
</button>
</ion-content>
</ion-view>
//Angular code
$scope.disable=function(){
$scope.disabled=true;
}