Create example4-Factory

var app = angular.module('MonApp',[])
app.factory('CommentsFacotry',function(){
var factory ={
comments://data in the form of json,
						   getComments:function(){
						   			   return factory.comments;
						   },
						   getComment:function(idComment){
						   			  return factory.comments[idComment];
						   },
	    			     }
			return factory;
}
});

app.controller('CommentCtrl',function($scope,CommentsFacotry){}); // inject your dependence of Factory