-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
43 lines (27 loc) · 849 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
* Created by crs on 8/28/16.
*/
var pizzaareaApp = angular.module('pizzaareaApp', ['ui.router']);
pizzaareaApp.config(function ($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise('/');
$stateProvider
// HOME STATES AND NESTED VIEWS ========================================
.state('home', {
url: '/',
templateUrl: 'home.html',
controller: 'pareaController'
})
});
pizzaareaApp.controller('pareaController', function ($scope) {
$scope.area = function () {
var radius = parseInt($scope.x) / 2;
console.log(radius);
if (radius > 0)
{
return radius * radius * Math.PI;
}
else if (radius <= 0) {
alert('Hey dude are you getting that pizza or not ! :P');
}
}
});