$scope.Obj = {
Allcontent: []
};
var ContentName = [];
$scope.fileName = ["login", "info"];// html file names
var input = document.getElementById("Myinput");// search box id
var value = input.value.toUpperCase();
angular.forEach($scope.fileName, function(Value) {
$.get('file/'+Value+'.html', function(result) {
var input, filter, title, i;
var path = $(result).find('meta').content;
input = $(result).find('h1').innerHTML.toUpperCase();
title = $(result).find('title').innerHTML.toUpperCase();
$scope.Obj['Allcontent'].push({"Value":title, "Path":path});
$scope.Obj['Allcontent'].push({"Value":input, "Path":path});
ContentName.push(title);
ContentName.push(input);
ContentName= [ ...new Set(ContentName) ];// for remove duplicate values
$scope.getContentName= ContentName.filter(el => el.includes(value));
});
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.