//文件上传服务层app.service("uploadService",function($http){
this.uploadFile=function(){
var formData=new FormData(); formData.append("file",file.files[0]); return $http({
method:'POST', url:"../upload.do", data: formData,
headers: {'Content-Type':undefined}, transformRequest: angular.identity
});
}
});
//商品控制层(商家后台)
app.controller('goodsController' ,function($scope,$controller ,goodsService,itemCa tService,uploadService){
<script type="text/javascript" src="../js/base.js"> </script>
<script type="text/javascript" src="../js/service/goodsService.js"> </script>
<script type="text/javascript" src="../js/service/itemCatService.js"> </script>
<script type="text/javascript" src="../js/service/uploadService.js"> </script>
<script type="text/javascript" src="../js/controller/baseController.js"> </script>
<script type="text/javascript" src="../js/controller/goodsController.js"> </script>
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |