"use strict";
define([],function(){
	function model(value){
		var __meta = {},__data = [],object = {meta:__meta,data:__data};
		
		function list(){
			return angular.copy({meta:__meta,data:__data});
		};
		function error(){
			return angular.copy({meta:__meta});
		};
		function save(data){
			if(!data.hasOwnProperty('id')){
				data.id = __data.length;
				__data.push(data);
			}else{
				for(var i in __data){
					var datum = __data[i];
					if(datum.id==data.id){
						__data[i] = data;
						break;
					}
				}
			}
			return angular.copy({meta:__meta,data:data});
		}
		function setMeta(meta){
			__meta = meta;
		}
		function setData(data){
			for(var i in data){
				var datum = data[i];
				if(!datum.hasOwnProperty('id'))
					datum.id= __data.length;
				__data.push(datum);
			}
		}
		object.GET = function(){
			return {success:list(),error:error()};
		}
		object.POST = function(data){
			return {success:save(data),error:error()};
		}
		
		if(value.hasOwnProperty('meta'))setMeta(value.meta);
		if(value.hasOwnProperty('data'))setData(value.data);
		
		return object;
	}
	return model;
});
@@ -53,16 +53,64 @@
 value)%7B%0A
+%09%09var DEFAULT_PAGE = 1;%0A%09%09var DEFAULT_ITEM = 5;%0A
 %09%09var __
@@ -185,24 +185,424 @@
 ion list()%7B%0A
+%09%09%09var config = arguments%5B0%5D%7C%7C%7B%7D;%0A%09%09%09var page = config.page%7C%7CDEFAULT_PAGE;%0A%09%09%09var limit = config.limit%7C%7CDEFAULT_ITEM;%0A%09%09%09var index = ((page - 1) * limit);%0A%09%09%09var data = __data.slice(index,index+limit);%0A%09%09%09var meta = __meta;%0A%09%09%09meta.page = page;%0A%09%09%09meta.count = __data.length;%0A%09%09%09meta.last = Math.ceil(meta.count/limit);%0A%09%09%09meta.next =  page%3Cmeta.last?page+1:null;%0A%09%09%09meta.prev =  page%3E1?page-1:null;%0A
 %09%09%09return an
@@ -610,34 +610,32 @@
 ular.copy(%7Bmeta:
-__
 meta,data:__data
@@ -624,26 +624,24 @@
 a:meta,data:
-__
 data%7D);%0A%09%09%7D;
@@ -1256,24 +1256,28 @@
  = function(
+data
 )%7B%0A%09%09%09return
@@ -1291,16 +1291,20 @@
 ss:list(
+data
 ),error:

Create pagination for test data