I am trying to fetch string arrays from a json file and return the data back to a variable to form a word filer list, but "uncaught syntax error" kept showing can anyone help? Here comes my code:
var filterWords = $http.get('word.json').success(function(res) {
return angular.fromJson(res.data);
});
$scope.filterWord = function($string) {
var wRegExp = new RegExp(filterWords.join("|"), "gi");
return wRegExp.test($string);
};
Thanks in advance!
syntax errorhere. Some another part of your code causes an error.filterWordseven after thefilterWord()called?