(function () {
'use strict';
angular.module('ion-floating-menu', [])
.directive('ionFloatingButton', ionFloatingButton)
.directive('ionFloatingMenu', ionFloatingMenu)
.directive('ionFloatingItem', ionFloatingItem)
.factory('$ionicBackdropIon', $ionicBackdropIon);
function ionFloatingButton() {
return {
restrict: 'E',
scope: {
click: '&?',
buttonColor: '@?',
buttonClass: '@?',
icon: '@?',
iconColor: '@?',
hasFooter: '=?',
isCentered: '=?',
text: '@?',
textClass: '@?',
bottom: '@?'},
template: '<ul ng-click="click()" id="floating-button" ng-class="{\'center\': isCentered}" ng-style="{\'bottom\' : \'{{bottom}}\' }">' +
'<li ng-class="buttonClass" ng-style="{\'background-color\': buttonColor }">' +
'<a><span ng-if="text" class="label-container"><span class="label" ng-class="textClass" ng-bind="text"></span></span><i class="icon menu-icon" ng-class="{ \'{{icon}}\' : true}" ng-style="{\'color\': iconColor }"></i></a>' +
'</li>' +
'</ul>',
replace: false,
transclude: true,
controller: ionFloatingButtonCtrl
};
}
ionFloatingButtonCtrl.$inject = ['$scope'];
function ionFloatingButtonCtrl($scope) {
$scope.buttonColor = $scope.buttonColor || '#2AC9AA';
$scope.icon = $scope.icon || 'ion-plus';
$scope.iconColor = $scope.iconColor || '#fff';
$scope.hasFooter = $scope.hasFooter || false;
$scope.isCentered = $scope.isCentered || false;
if ($scope.hasFooter) {
$scope.bottom = '60px';
} else {
$scope.bottom = $scope.bottom || '20px';
}
}
// Rest of the code follows...
})();
/*! CSS code here... */
<html ng-app="ionicApp">
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title>Toggle</title>
<link href="//code.ionicframework.com/nightly/css/ionic.css" rel="stylesheet">
<script src="//code.ionicframework.com/nightly/js/ionic.bundle.js"></script>
</head>
<body ng-controller="MainCtrl">
HI
<input type="button" value ="click me" ng-click="test()" />
<!-- <button type="button" value="Click me" ></button> -->
</ion-content>
<ion-floating-menu>
<ion-floating-item icon="ion-camera" ng-click="first()" text="Add Contact"></ion-floating-item>
<ion-floating-item icon="ion-person" ng-click="myEvent()" text="My Contact"></ion-floating-item>
</ion-floating-menu>
</body>
</html>