全局搜索以下是我正在試圖仿效全局搜索功能:https://plnkr.co/edit/DRagFo?p=previewAngularJS不工作
這裏是我的嘗試:https://plnkr.co/edit/n4aczq?p=preview
他們寫略有不同,但我似乎無法弄清楚,爲什麼全局搜索不起作用。我相信這與$scope.parsedEntries.push(parse(content));
在script.js
做的事:提前
angular.module('myApp', ['smart-table','lrDragNDrop'])
.controller('mainCtrl', ['$scope', '$timeout', '$http',
function ($scope, $timeout, $http) {
var url = 'https://spreadsheets.google.com/feeds/list/1O7M5gaEGlyE5gkOBARJrxJJMBYiTwz2THVjgbaTx9v8/od6/public/values?alt=json';
var parse = function (entry) {
console.log(entry);
var description = entry.gsx$description.$t;
var cause = entry.gsx$cause.$t;
return {
description: description,
cause: cause
};
};
$http.get(url)
.then(function (response) {
var entries = response.data.feed.entry;
$scope.parsedEntries = [];
for (var key in entries) {
var content = entries[key];
$scope.parsedEntries.push(parse(content));
}
});
}
]);
感謝。