Create clickable buttons in Ionic v1 card - angularjs

I have a project in Ionic v1 and I am making some enhancements to it.
I have a list of cards where the card itself is clickable to take the user to more details. I need to add couple buttons on the card but I can't get the clicks to be captured by the button - the click goes to the card href. Sample code below.
<div class="list card" ng-repeat="(evtKey, evtObj) in someHash">
<div class="item" ng-click="clickCard(evtKey)">
<div class="row">
<div class="col-20 row-center">
<div> Some stuff here</div>
</div>
<div class="col-80 item-text-wrap">
<div> More stuff here </div>
<div class="row text-center">
<div class="col col-33">
<div> More stuff </div>
</div>
<div class="col col-33">
<button class="button button-small button-stable" ng-click="alert('Yes')">Yes</button>
</div>
<div class="col col-33">
<button class="button button-small button-stable" ng-click="alert('No')">No</button>
</div>
</div>
</div>
</div>
<p class="item-icon-right"><i class="icon ion-chevron-right icon-accessory"></i></p>
</div>
</div>
Looking for help on how to make the click on the button be captured by the button and not by the card. Examples I have found so far are all on doing that with Ionic v2 and later and not for v1.
Thanks,
-S

event.stopPropagation() will stop calling event from parent elements. And also don't put alert in ng-click
<div class="col col-33">
<button class="button button-small button-stable" type="button" ng-click="somefunc('Yes');$event.stopPropagation();">Yes</button>
</div>
<div class="col col-33">
<button class="button button-small button-stable" type="button" ng-click="somefunc('No');$event.stopPropagation();">No</button>
</div>

Related

How do you add a "Next" button in a section in jquery-steps?

<div class="wizard" id="createacc">
<h5>Link</h5>
<section class="text-center">
<div class="pos-vertical-center">
<h4>Welcome to the sign in wizard. Please link your account if you're a debater.</h4>
<div class="row">
<div class="col-sm-2"></div>
<div class="col-xs-12 col-sm-12">
<button class="btn btn--primary type--uppercase" type="submit">Link account</button>
</div>
<div class="col-sm-2"></div>
</div>
<br>
<div class="row">
<div class="col-sm-2"></div>
<div class="col-xs-12 col-sm-12">
<button class="btn btn--primary type--uppercase" type="submit">I want to add the "next" button here </button>
</div>
<div class="col-sm-2"></div>
</div>
</div>
</section> ... more code
</div>
I just wanted to add the "next" button within one of the sections as a substitute for the next button at the bottom. I've looked around and couldn't seem to find anything. I also tried to copy the class and the href #next and that didn't seem to work.

Background slider for ionic v1

I am currently working of a ionic v1 project and i need to add a background slideshow for the application but cannot find how to do that in ionic. I have tried https://tympanus.net/codrops/2013/04/17/background-slideshow/ but i need something that works with angular.js.
Thanks
<ion-content scroll="false" class="padding">
<div class="full">
<div class="half">
<ion-slides options="options" slider="data.slider">
<ion-slide-page>
<center> <i class="ion-android-archive homefont"></i>
<h2>Post a request</h2>
<p></p>
</center>
</ion-slide-page>
<ion-slide-page>
<center> <i class="ion-locked homefont"></i>
<h2>Safe Deposit</h2>
<p></p>
</center>
</ion-slide-page>
<ion-slide-page>
<center> <i class="ion-plane homefont"></i>
<h2>Traveller Fulfills</h2>
<p></p>
</center>
</ion-slide-page>
</ion-slides>
</div>
<div class="2half">
<div class=" padding-top">
<center > <img src="img/logo.jpg" alt="logo" width=80 height=80></center>
</div>
<div class=" padding-vertical">
<button class="button button-block button-positive">
Post Your Request
</button></div>
<button class="button button-block button-positive">
Post Your Trip
</button>
</div>
</div>
</ion-content>
class full will have a height of 100% while half and 2half will both have a height of 50% and display value is block.
to make the slider to a full background slider class half height will be 100%

angularjs stop at last item ng-repeat

I'm building an app with AngularJS.
Inside this app I would like to have 2 buttons on each row, except when the total buttons are not even.
How can I let the code stop creating the last col?
With the next code the 6th button (on a array with 5 items) is empty. I don't want this one on the screen.
<div ng-repeat="tool in tools">
<div class="row" ng-if="$even">
<div class="col" ng-repeat="tool in [tools[$index],tools[$index + 1]]">
<button class="button button-block button-{{tool.color}}">
<i class="icon {{tool.icon}}"></i>
<br>{{tool.name}}
</button>
</div>
</div>
</div>
Switch the inner ng-repeat to use limitTo filter;
<div ng-repeat="tool in tools">
<div class="row" ng-if="$even">
<div class="col" ng-repeat="tool in tools | limitTo:2:$index">
<button class="button button-block button-{{tool.color}}">
<i class="icon {{tool.icon}}"></i>
<br>{{tool.name}}
</button>
</div>
</div>
</div>

Ionic slider not showing content initially

When i load a template on click of button using $state.go() slider embedded in template not displaying its content.
When i rotated my device then it start showing the slides.
Please sugggest what i am missing in this code snippet of template.
<ion-slide-box on-slide-changed="" show-pager="true">
<ion-slide ng-repeat="placementStep in placementSteps">
<div class="list card">
<div class="item-divider">
<div class="row">
<div class="col">
<h1 class="title">{{placementStep.stepName}}</h1>
</div>
<div class="col">
<button class="button icon ion-chevron-right button-positive button-small right" ng-if="$index!=placementSteps.length-1&& placementStep.studentsForStep.length!=0" ng-click="moveStudents(placementStep,placementSteps,0)"></button>
<button class="button icon ion-chevron-left button-positive button-small right" ng-if="$index!=0 && placementStep.studentsForStep.length!=0" ng-click="moveStudents(placementStep,placementSteps,1)"></button>
</div>
</div>
</div>
<ion-list show-reorder="data.showReorder" can-swipe="false" ng-class="has-header">
<ion-item ng-repeat="student in placementStep.studentsForStep">
<div class="row">
<div class="left checkbox">
<input type="checkbox" ng-checked="student.checked==true" ng-model="student.checked">
</div>
<div class="col vertical-center">
{{student.first_name}}
</div>
</div>
</ion-item>
</ion-list>
</div>
</ion-slide>
</ion-slide-box>
</ion-content>
Call This function,
$ionicSlideBoxDelegate.update();
Immediately after loading the image files or directly within the controller definition for that view.
notice the absence of of the getbyhandle();
I used delegate handle to update the slide box after loading data. It worked.
$ionicSlideBoxDelegate.$getByHandle('placementStepSlideBox').update();
Where "placmentStepSlideBox" is the delegate handle name.

Bootstrap 3 ordering grid column in responsive layout

I using Bootstrap 3 and like to re-ordering the grid column in mobile layout.
Desktop is looks like as screenshot:
where open in mobile phone, the picture is goes to bottom, isn't possible to place the picture to top by re-ordering the grid column when user view in mobile version?
code for the output:
<div class="container">
<div class="row">
<div class="col-sm-8 col-lg-9">
<div>John Smith</div>
<div>Application Engineer</div>
<div>
<dl class="dl-horizontal">
<dt>Reg. Number</dt><dd>M8553</dd>
<dt>Mobile Number</dt><dd>012-5229887</dd>
<dt>Email</dt><dd>john.smith#email.com</dd>
</dl>
</div>
<div class="row">
<div class="col-xs-12 col-lg-2"><img src="QR-code.png" width="78" /></div>
<div class="col-xs-12 col-lg-10">
<div>
<span>
<button type="button" class="btn btn-primary" data-id="10"><span class="fa fa-fw fa-thumbs-o-up"></span> Like</button>
</span>
<a class="btn btn-success btn-alink" role="button" href="mailto:feedback#email.com?subject=Feedback"><span class="fa fa-fw fa-envelope-o"></span> Send us your feedback</a>
</div>
<div><span>0</span> liked, 63 views.</div>
</div>
</div>
</div>
<!-- /.col-lg-9 -->
<div class="col-sm-4 col-lg-3">
<img src="images/john-smith.jpg" alt="john-smith">
</div>
<!-- /.col-lg-3 -->
</div>
<!-- /.row -->
</div>
Take a look at this
Column ordering
Easily change the order of our built-in grid columns with .col-md-push-* and .col-md-pull-* modifier classes.
heres the link http://getbootstrap.com/css/

Resources