@ -1,6 +1,6 @@
app . controller ( 'NewClassController' , [ '$scope' , '$http' , 'auth' , 'config' , 'alertService' , '$location' , function ( $scope , $http , auth , config , alertService , $location ) {
app . controller ( 'NewClassController' , [ '$scope' , '$http' , 'auth' , 'config' , 'alertService' , '$location' , 'rms' , function ( $scope , $http , auth , config , alertService , $location , rms ) {
var vm = $scope ;
var vm = $scope ;
vm . alertService = alertService . create ( ) ;
vm . alertService = alertService . create ( ) ;
@ -40,7 +40,9 @@ app.controller('NewClassController', ['$scope', '$http', 'auth', 'config', 'aler
vm . alertService . showMessage ( '出错了' , response . data . message ) ;
vm . alertService . showMessage ( '出错了' , response . data . message ) ;
} else {
} else {
vm . alertService . showMessage ( '提示' , '新建课程成功' , function ( ) {
vm . alertService . showMessage ( '提示' , '新建课程成功' , function ( ) {
window . history . back ( ) ;
// window.history.back();
rms . save ( 'syllabuses' , [ ] ) ;
$location . path ( "/class_list" ) ;
} ) ;
} ) ;
}
}
console . log ( response . data . data ) ;
console . log ( response . data . data ) ;