trying to create a Date object (using time only) and accessing that value outside of my function
Any help would be appreciated. See code below or my plunker
var objts = "";
$scope.today = function() {
$http.get('time.json').success(function(data, status, headers, config) {
objts = new Date(data.time_start);
objte = new Date(data.time_end);
console.log(data);
}).error(function(data, status, headers, config) {
console.log("No data found..");
});
$scope.dt = objts; // ---- Trying to use value of objts here ----
};
$scope.today();
Thanks