mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-01 08:56:08 +08:00
chore(docs/search): ensure that default search goes to API first
Closes #9736
This commit is contained in:
@@ -41,10 +41,14 @@ angular.module('search', [])
|
||||
|
||||
$scope.submit = function() {
|
||||
var result;
|
||||
for(var i in $scope.results) {
|
||||
result = $scope.results[i][0];
|
||||
if(result) {
|
||||
break;
|
||||
if ($scope.results.api) {
|
||||
result = $scope.results.api[0];
|
||||
} else {
|
||||
for(var i in $scope.results) {
|
||||
result = $scope.results[i][0];
|
||||
if(result) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(result) {
|
||||
|
||||
Reference in New Issue
Block a user