kitchenApp.controller('HomeCtrl', function ($scope,$http, $stateParams, $state) {
$http({
method: 'GET',
url: 'http://rest.ilefe.cn/rest/product/read_list'
}).then(function successCallback(response) {
$scope.data = response.data.data;
console.log(response.data.data);
}, function errorCallback(response) {
alert("没有获取到");
});
$scope.fetch1 = function() {
$(function() {
$(".list-title ul > li").click(function() {
$(this).addClass("finger").siblings().removeClass("finger");
});
});
$http({
method: 'GET',
url: 'http://rest.ilefe.cn/rest/product/read_list'
}).then(function successCallback(response) {
$scope.data = response.data.data;
console.log(response.data.data);
}, function errorCallback(response) {
alert("没有获取到");
});
};
$scope.fetch2 = function() {
$(function() {
$(".list-title ul > li").click(function() {
$(this).addClass("finger").siblings().removeClass("finger");
});
});
$http({
method: 'GET',
url: 'http://rest.ilefe.cn/rest/product/readlist/category_id/6'
}).then(function successCallback(response) {
$scope.data = response.data.data;
console.log(response.data.data);
}, function errorCallback(response) {
alert("没有获取到");
});
};
$scope.fetch3 = function() {
$(function() {
$(".list-title ul > li").click(function() {
$(this).addClass("finger").siblings().removeClass("finger");
});
});
$http({
method: 'GET',
url: 'http://rest.ilefe.cn/rest/product/readlist/category_id/7'
}).then(function successCallback(response) {
$scope.data = response.data.data;
console.log(response.data.data);
}, function errorCallback(response) {
alert("没有获取到");
});
};
});
添加回答
举报
0/150
提交
取消