You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trustieforge/public/javascripts/wechat/controllers/class_list.js

30 lines
743 B

/**
* Created by guange on 16/6/27.
*/
app.controller('ClassListController', ['$scope','config','auth','$http','$location', function($scope, config, auth, $http, $location){
var vm = $scope;
vm.courses = [];
$http.get(config.apiUrl + "courses?token="+ auth.token() + "&per_page_count=10&page=1").then(
function(response){
console.log(response.data);
vm.courses = response.data.data;
}
);
vm.goClass = function(course_id){
console.log(course_id);
$location.path("/myclass").search({id: course_id});
}
vm.newClass = function(){
$location.path("/new_class");
}
vm.goResource =function(){
$location.path("/myresource");
}
}]);