add search page in search web app

This commit is contained in:
wlh
2014-12-12 16:20:05 +08:00
parent f05ae96998
commit 98c562ee8e
9 changed files with 127 additions and 42 deletions
+20
View File
@@ -0,0 +1,20 @@
/*仅负责搜索页面的打开*/
var SearchController = function($scope, $rootScope, $location){
var path = $location.path();
$scope.goToSearch = function(){
if(path.indexOf('/book') !== -1 || path === '/'){
$location.path('/search/book');
}else if(path.indexOf('/music') !== -1 || path === '/music'){
$location.path('/search/music');
}else if(path.indexOf('/movie') !== -1 || path === '/movie'){
$location.path('/search/movie');
}
};
};
SearchController.$inject = ['$scope', '$rootScope', '$location'];
app.controller('SearchController', SearchController);