Angular JS code Not work
-
Could you please suggest me how i can make this concept ,if time1
Time1 :
Time2 :
Your Time is ans is {{(time1-time2)| correcttime | date: 'HH:mm': 'UTC'}}
var app = angular.module('myApp', []); app.filter('correcttime', function() { if { time1>24; time1=+1; } else if { time1=time2; time1-time2==0; } else{ time1-time2; } return function(num) { return Math.abs(num); } });
-
Could you please suggest me how i can make this concept ,if time1
Time1 :
Time2 :
Your Time is ans is {{(time1-time2)| correcttime | date: 'HH:mm': 'UTC'}}
var app = angular.module('myApp', []); app.filter('correcttime', function() { if { time1>24; time1=+1; } else if { time1=time2; time1-time2==0; } else{ time1-time2; } return function(num) { return Math.abs(num); } });
I am not an expert in AngularJS, but looking at the following code:
if {
time1>24; // if time1 is greater than 24
time1=+1; // set time1 equal to 1. I think you really mean to subtract 24 from time1
}
else if { // else
time2=time2; // if time2 equals time2, which will always be true
time1==0; // set time1 to zero: why?
}
else{
time1-time2; // otherwise calcualate time1 minus time2, but what happens to this value?
}I would be happy to read an explanation of why my assumptions are wrong.
-
I am not an expert in AngularJS, but looking at the following code:
if {
time1>24; // if time1 is greater than 24
time1=+1; // set time1 equal to 1. I think you really mean to subtract 24 from time1
}
else if { // else
time2=time2; // if time2 equals time2, which will always be true
time1==0; // set time1 to zero: why?
}
else{
time1-time2; // otherwise calcualate time1 minus time2, but what happens to this value?
}I would be happy to read an explanation of why my assumptions are wrong.
I was going to comment on the lack of a controller, the capitalization issue, and the malformed conditional statements, but no real point until the core logic is sorted.
"There are three kinds of lies: lies, damned lies and statistics." - Benjamin Disraeli
-
I was going to comment on the lack of a controller, the capitalization issue, and the malformed conditional statements, but no real point until the core logic is sorted.
"There are three kinds of lies: lies, damned lies and statistics." - Benjamin Disraeli