试图创建一个Date对象(仅限于使用时间)和访问我的功能
任何帮助的之外的价值,将不胜感激。请参见下面的代码或我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();
感谢
你只会得到异步调用响应在其回调.. –