Mobile Application _BMI with pictures

31

<div class="item item-image">
<img src="img/bmi0.png" style="height:200px;width:100px">
</div>
เอารูปภาพไว้ตรงกลางหน้าจอ item-image
------------------------------------------------------------------
Index.html
// Ionic Starter App
// angular.module is a global place for creating, registering and retrieving Angular modules
// 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)
// the 2nd parameter is an array of 'requires'
angular.module('starter', ['ionic'])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
if (window.cordova && window.cordova.plugins.Keyboard) {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
// Don't remove this line unless you know what you are doing. It stops the viewport
// from snapping when text inputs are focused. Ionic handles this internally for
// a much nicer keyboard experience.
cordova.plugins.Keyboard.disableScroll(true);
}
if (window.StatusBar) {
StatusBar.styleDefault();
}
});
})
.controller('MyCon', function($scope) {
$scope.BMI_STATUS = "Please enter Height and Weight...";
$scope.BMI_VALUE = 0.00;
$scope.BMI_IMAGE = "img/bmi0.png";
$scope.calBMI = function() {
$scope.BMI_VALUE = $scope.Weight / (($scope.Height / 100) * ($scope.Height / 100));
if ($scope.BMI_VALUE > 30) {
$scope.BMI_STATUS = 'BigFAT Level 3';
$scope.BMI_IMAGE = "img/bmi5.png";
} else if ($scope.BMI_VALUE > 25) {
$scope.BMI_STATUS = 'BigFAT Level 2';
$scope.BMI_IMAGE = 'img/bmi4.png';
} else if ($scope.BMI_VALUE > 23) {
$scope.BMI_STATUS = 'BigFAT Level 1';
$scope.BMI_IMAGE = 'img/bmi3.png';
} else if ($scope.BMI_VALUE > 18.50) {
$scope.BMI_STATUS = 'Normal Good health';
$scope.BMI_IMAGE = 'img/bmi2.png';
} else {
$scope.BMI_STATUS = 'Thin';
$scope.BMI_IMAGE = 'img/bmi1.png';
}
}
});
------------------------------------------------------------------------------
Add.js
// Ionic Starter App
// angular.module is a global place for creating, registering and retrieving Angular modules
// 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)
// the 2nd parameter is an array of 'requires'
angular.module('starter', ['ionic'])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
if (window.cordova && window.cordova.plugins.Keyboard) {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
// Don't remove this line unless you know what you are doing. It stops the viewport
// from snapping when text inputs are focused. Ionic handles this internally for
// a much nicer keyboard experience.
cordova.plugins.Keyboard.disableScroll(true);
}
if (window.StatusBar) {
StatusBar.styleDefault();
}
});
})
.controller('MyCon', function($scope) {
$scope.BMI_STATUS = "Please enter Height and Weight...";
$scope.BMI_VALUE = 0.00;
$scope.BMI_IMAGE = "img/bmi0.png";
$scope.calBMI = function() {
$scope.BMI_VALUE = $scope.Weight / (($scope.Height / 100) * ($scope.Height / 100));
if ($scope.BMI_VALUE > 30) {
$scope.BMI_STATUS = 'BigFAT Level 3';
$scope.BMI_IMAGE = "img/bmi5.png";
} else if ($scope.BMI_VALUE > 25) {
$scope.BMI_STATUS = 'BigFAT Level 2';
$scope.BMI_IMAGE = 'img/bmi4.png';
} else if ($scope.BMI_VALUE > 23) {
$scope.BMI_STATUS = 'BigFAT Level 1';
$scope.BMI_IMAGE = 'img/bmi3.png';
} else if ($scope.BMI_VALUE > 18.50) {
$scope.BMI_STATUS = 'Normal Good health';
$scope.BMI_IMAGE = 'img/bmi2.png';
} else {
$scope.BMI_STATUS = 'Thin';
$scope.BMI_IMAGE = 'img/bmi1.png';
}
}
});

32 33
34

Bookmark the permalink.

Comments are closed