This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function calculateDistance(rssi) { | |
var txPower = -59 //hard coded power value. Usually ranges between -59 to -65 | |
if (rssi == 0) { | |
return -1.0; | |
} | |
var ratio = rssi*1.0/txPower; | |
if (ratio < 1.0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('yourModule') | |
.directive('tabsSwipable', ['$ionicGesture', function($ionicGesture){ | |
// | |
// make ionTabs swipable. leftswipe -> nextTab, rightswipe -> prevTab | |
// Usage: just add this as an attribute in the ionTabs tag | |
// <ion-tabs tabs-swipable> ... </ion-tabs> | |
// | |
return { | |
restrict: 'A', | |
require: 'ionTabs', |