-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
35 lines (28 loc) · 717 Bytes
/
Copy pathapp.js
File metadata and controls
35 lines (28 loc) · 717 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
33
34
35
(function () {
'use strict';
angular.module('LunchCheck', [])
.controller('MyController', function ($scope) {
$scope.nameofmanue = "";
$scope.message = null;
$scope.CheckLunch = function () {
var totalName = messagelength($scope.nameofmanue);
$scope.message = totalName;
};
function messagelength(string) {
var message= null;
var arrayOfStrings=string.split(',');
if (arrayOfStrings =="") {
message="Please enter data first.";
return message;
}
if (arrayOfStrings !="" && arrayOfStrings.length <= 3) {
message="Enjoy!";
return message;
}
if (arrayOfStrings.length > 3) {
message="Too much!";
return message;
}
}
});
})();