-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
32 lines (25 loc) · 729 Bytes
/
Copy pathapp.js
File metadata and controls
32 lines (25 loc) · 729 Bytes
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
(function() {
'use strict';
angular.module('myFirstApp', [])
.controller('myFirstController',function($scope){
// Sharing Data through views
$scope.name = 'Saboor';
$scope.sayHello = function() {
return "Hello Saboor";
};
// Calculator App
$scope.totalValue = 0;
$scope.displayNumeric = function()
{
var totalNameValue = calculateNumericForString($scope.name);
$scope.totalValue = totalNameValue;
};
function calculateNumericForString(string){
var totalStringValue = 0;
for (var i = 0; i < string.length; i++) {
totalStringValue += string.charCodeAt(i);
}
return totalStringValue;
}
})
})();