1、创建服务的5种方式
//创建服务(1)
 app.service("studentInfo",function(){
				this.info = function(){
					return{
						UserId:"B13020505",
          				UserName:"小芳",
          				UserGender:"女",
           				UserAge:"19",
           				UserHobby:"写字",
		   				UserProfession:"汉语言文学"
					}
				}
			})
			//创建服务(2)
			app.constant("studentInfoXW",{
					UserId:"B13020506",
          			UserName:"小王",
          			UserGender:"男",
           			UserAge:"19",
           			UserHobby:"历史",
		  			UserProfession:"汉语言文学"
			})
			//创建服务(3)
			app.value("studentInfoZS",{
					UserId:"B13020507",
          			UserName:"张三",
          			UserGender:"男",
           			UserAge:"22",
           			UserHobby:"古玩",
		  			UserProfession:"考古专业"
			})
			//创建服务(4)
			app.factory("studentInfoLS",function(){
				return{
					UserId:"B13020508",
          			UserName:"李四",
          			UserGender:"男",
           			UserAge:"21",
           			UserHobby:"数学",
		  			UserProfession:"数学专业"
				}
			})
			//创建服务(5)
			app.provider("studentInfoWYY",function(){
				this.$get = function(){
					return{
					UserId:"B13020509",
          			UserName:"王语嫣",
          			UserGender:"女",
           			UserAge:"20",
           			UserHobby:"古典音乐",
		  			UserProfession:"古典音乐专业"
					}
				}
			})  
2,angular get/post请求方式
// 1、http()
//				$http({
//					 url: "student.json",
//			    	 method: "GET"
//				})
//				.success(function(data){
//					console.log(data);
//					$scope.StudentList = data.student;
//				})
//				.Error(function(data){
//						console.log(data);
//						console.log("出错了!");
//				})
//				2、$http.get("student.json")
//					.success(function(data){
//						$scope.StudentList = data.student;
//					})
//					.error(function(data){
//						console.log(data);
//						console.log("出错了!");
//					})
3.$http.post("JSON/student.json")
					.success(function(data){
						$scope.StudentList = data.student;
					})
					.error(function(data){
						console.log(data);
						console.log("出错了!");
					})
3、行内式依赖注入的好处和优点
行内式依赖注入防止代码压缩将$scope换成-d导致代码压缩后出现不可预料的错误
原文:http://www.cnblogs.com/Xiaozeze/p/7358047.html