mirror of
https://github.com/wu736139669/vczero.github.io.git
synced 2026-08-05 06:23:38 +00:00
19 lines
633 B
JavaScript
19 lines
633 B
JavaScript
/*初始化图书列表页*/
|
|
app.controller('BookListController', function($rootScope, bookList){
|
|
if(!$rootScope.keywordsObj.book){
|
|
$rootScope.keywordsObj.book = 'C语言';
|
|
}
|
|
bookList.getData($rootScope.keywordsObj.book);
|
|
});
|
|
|
|
|
|
/*图书详情页*/
|
|
app.controller('BookDetailController', function($rootScope, $http, $scope, $location, ServiceConfig){
|
|
var bookId = $location.path().split('/book/')[1] || '';
|
|
$rootScope.isNoLoaded = true;
|
|
$http.jsonp(ServiceConfig.book_search_id + '' + bookId + '?callback=showBookDeatil');
|
|
window.showBookDeatil = function(data){
|
|
$rootScope.isNoLoaded = false;
|
|
$scope.data = data;
|
|
};
|
|
}); |