Note: The code below is just logic, so no parameters are defined. Although they are defined and being used actively in the same javascript file i'm in.
I'm new to javascript/angularjs (I don't even know what code this is) and as of now it's really throwing me a curveball because of the syntax and everything else going on. I have a main function in my dateTimeService.js file being called that returns another function that returns a true/false value based on if store is open or closed using logic below.
app.factory("dateTimeService", function() {
return {
isHelperOpen: function(hoursString) {
if (openTime <= nowTime && nowTime <= closeTime)
return true;
else
return false;}
}
}
How can I display a value such as "Open" or "Closed" based on the true/false value being returned by one of those functions? How is the html displayed? Do I create another function to do this? Any help is appreciated.. Thanks in advance!
<div class="availability">{{isHelperOpen(item)}}</div> --this is my long shot