I declare a nav button in index page and it shown all the page But I want remove from my home page. How can I remove that button in that specific pages
make $rootScope array of pages where you don't want to show the button. Then use ng-if in button tag to show n hide the button
<button ng-if="root.pageIgnore.indexOf($route.current.name) === -1">Shy Button</Button>
Related
I am trying to implement segmented control button instead of normal radio button in Angular
Although If i remove CSS class, normal radio button is working fine and remain selected on navigating to another page os clicking anywhere on the same page, but after adding CSS, radio button selection do not remain intact and deselects.
Please help with this
HTML Code :
<div class ="segmented-control">
<div ng-repeat="p in LP">
<a href="#" class="list-group-item">
<label> {{p.label}}
<input type ="radio" ng-model="test" name="test" value="{{p.value}}" ng-click="getElement($event)"></label>
</a>
</div>
</div>
CSS :
.segmented-control input[type="radio"] {
visibility:hidden;
}
.segmented-control .list-group-item {
display: inline-block;
}
In controller.js
calling below function to get the value of radio button
$scope.getElement= function(obj){
$scope.test = obj.target.value;
}
There are 2 issues with your code:
You have nested elements <div><a tag><label><radio></label> but the ng-model will be set only when you click exactly on the label. If you click little outside the label the ng-model will not be updated.
The gray color change that you see when you click on the segmented button does not mean that the radio button is selected. It is applying the following bootstrap class a.list-group-item:focus which means the button is in focus. That is why when you click outside the button the color changes back to white.
To solve this you have to add extra class to highlight the selected button and make sure your ng-model is updated no matter where the user clicks inside the div.
I have created a sample jsfiddle to demonstrate both the issues. Good luck and welcome to Stackoverflow!
I have a dripdrowns...once d last drop down is selected I'll be displaying some content, for that toggling I want to add some beautiful animations. Is there any react related things to implement this?
sidebarToggle(e) {
e.preventDefault();
document.body.classList.toggle('sidebar-hidden');
}
<a className="nav-link navbar-toggler sidebar-toggler" onClick={this.sidebarToggle} href="#">☰</a>
You can do like this
It will show button and on clicking that button will toggle sidebar kind of animation from the left
I have a <div id="section1"> </div> at the bottom of my page.
And I have a button I want this functionality in button
$location.hash('section1');
$anchorScroll();
It is working as I want but it is giving me ugly url all this is in single page than why my url is updating?
my expecting Url is :
/Order/BuildOrder
when page load I get this but when I click button screen took me to my anchor div with id='section1'
but now url change to /Order/BuildOrder#!#section1
How can I remove #!# as this is scrolling on a single page. href location is not changing
I am trying to make simple demo in ionic. I have one footer having one icon ion-compose (bottom left icon). When I click on that icon it show a pop up screen I enter name in text field and press save button. Then it generates a row which have same text as written in textfield of popup screen. I need to add icon buttons on row (like delete button, edit button). Can we add icon on dynamically generated row as I did in footer (bottom left ion-composer)?
Please add ion on row
Here is my code
http://codepen.io/anon/pen/qdEEPW
<ion-item ng-repeat="item in items">
{{item.testcase}}
<ion-reorder-button class="ion-navicon"></ion-reorder-button>
</ion-item>
please press bottom button on left side of footer .when click it show pop up snd fill entry it generate the row.I need to add icons on row
I will show the image what i want
I need delete icon and edit button icon on row..you can choose amy icon from this link
http://ionicons.com/
Related: how to add icons in row which is generated dynamically in ionic
icons added.
You will have to add the functions for the buttons.
HTML:
<ion-item ng-repeat="item in items">
{{item.testcase}}
<button class="button {{item.close}}"></button>
<button class="button {{item.edit}}"></button>
JS:
myPopup.then(function(res) {
console.log('Tapped!', res);
if(typeof res!='undefined')
res.edit="ion-edit";
res.close="ion-close";
$scope.items.push(res)
console.log($scope.items);
});
http://codepen.io/anon/pen/XbJJzO
I'm making a functional button in my ionic app, and I want to know what I need to do to make a button centered on a blank ionic app load another page when clicked.
I have experimented with adding ng-click="loadPage()" to the button in my index.html file. I defined
$scope.loadPage = function() { $state.go(page.html)} in my controller.
switch your button with an anchor
<a class="btn btn-full" ui-sref="your.state">your text</a>