-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
52 lines (40 loc) · 1.05 KB
/
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
44
45
46
47
48
49
50
51
52
(function () {
'use strict';
function CustomFilterFactory()
{
return function(s) {
return "<<<" + s + ">>>";
}
}
function UmbrellaController($scope,$filter,customFilter)
{
$scope.name = '';
$scope.value = 0;
$scope.upper = function () {
var upcase = $filter('uppercase');
$scope.name = upcase( $scope.name );
}
$scope.displayNumeric = function() {
var totalNameValue = computeValueFromString($scope.name);
console.log('ok displayNumeric is called')
$scope.value = totalNameValue;
}
$scope.biteMe = function() {
return "Bite Me!";
}
$scope.changed = function() {
console.log( 'changed function called' );
}
}
angular.module('FantasticUmbrellaApp',[])
.controller('UmbrellaController', UmbrellaController)
.filter('custom',CustomFilterFactory);
function computeValueFromString( string ) {
console.log('Now computeValueFromString is called');
var totalStringValue = 0;
for (var i = 0; i < string.length; i++) {
totalStringValue += string.charCodeAt(i);
}
return totalStringValue;
}
})();