how to access the name and version id of app from controller and can we access the package.json file ???
Hi @sajith,
I’m using the following plugin in my applications:
With the plugin installed, put the following in your $ionicPlatform.ready function:
cordova.getAppVersion(function(version) {
appVersion = version;
});
Of course make sure that appVersion is a global variable so that way you can access it from any controller. This will find the version you put into your config.xml file.
2 Likes
and one more thing slidebox pager can not work properly if we add new slides after onchange function
There are more ‘dots’ shown on the advert carousel then there are images and though it may seem logical to swipe right to see them you are returned to the first dot - in the example there are 3 images but 5 dots and you cant get to dot 4 or dot 5!
<ion-nav-buttons side="left">
<button class="button button-icon button-clear ion-navicon" ng-click="showMenu()">
</button>
</ion-nav-buttons>
<ion-nav-buttons side="right">
<select class="ion-input-select " ng-model="location"
ng-options="loc.name for loc in options" ng-change="change(location)" ></select>
</ion-nav-buttons>
<ion-content >
<ion-refresher on-refresh="doRefresh()"
pulling-text="Pull to refresh..."
refreshing-text="Refreshing!"
refreshing-icon="ion-loading-c">
</ion-refresher>
<ion-slide-box
on-slide-changed="slideChanged($index)"
does-continue="true" scroll="true"
show-pager='true'
slide-interval="3000"
auto-play="true">
<ion-slide class="item-icon-left item-icon-right" ng-repeat="slide in slides" >
<i class="icon ion-chevron-left" ng-click="previous()" ng-if="slideIndex !=4 " ></i>
<div id="logo" >
<a href="#/tab/offers/{{slide.id}}" >
<img class="full-image" ng-src="{{slide.image}}" >
</a>
</div>
<i class="icon ion-chevron-right" ng-click="next()" ng-if="slideIndex != 4"></i>
</ion-slide>
</ion-slide-box>
<div class="list ">
<a ng-repeat="list in lists" class="item item-avatar-left item-icon-right" href="#/tab/offers/{{list.id}}">
<img ng-src="{{list.image}}">
<div class="row">
<div class="col-66">
<h4>{{list.offer}}</h4>
<h6>{{list.company}}|{{list.category}}</h6>
</div>
<span class=" item-note">
<h6>Expires:{{list.expires}}</h6>
<h6>Distance:{{list.distance}}</h6>
<i class="icon ion-chevron-right"></i>
</span>
</div>
</a>
</div>
</ion-content>