angular
	.module('ngSharepoint.Lists')
	.factory('SelectQuery', ['SPList', 'CamlBuilder', 'Query', 'WhereQuery', function(SPList, CamlBuilder, Query, WhereQuery) {
        var SelectQuery = function(fields) {
            this.__values = fields;
            this.__where = [];
            this.__limit = null;
            this.__order = [];
            //this.__queries.where = [];
            //this.__queries.limit = [];
            return this;
        };
        SelectQuery.prototype = new Query();
        SelectQuery.prototype.from = function(list) {
        	this.__list = list;
        	return this;
        };
        SelectQuery.prototype.where = function(field) {
            var query = new WhereQuery(this, field);
            this.__where.push(query);
            return query;
        };
        SelectQuery.prototype.limit = function(amount) {
            this.__limit = amount;
            return this;
        };
        SelectQuery.prototype.orderBy = function(field, asc) {
            if (angular.isUndefined(asc)) {
                asc = true;
            }
            this.__order.push({field: field, asc: asc});
            return this;
        };
        SelectQuery.prototype.__execute = function() {
            var camlBuilder = new CamlBuilder();
            var camlView = camlBuilder.push('View');
            if (this.__where.length > 0 || this.__order.length > 0) {
                var queryTag = camlView.push('Query');
                if (this.__where.length === 1) {
                    var camlWhere = queryTag.push('Where');
                    this.__where[0].push(camlWhere);
                }else if (this.__where.length > 1) {
                    var camlAnd = queryTag.push('Where').push('And');
                    this.__where.forEach(function(where) {
                        where.push(camlAnd);
                    });
                }
                if (this.__order.length > 0) {
                    var camlOrder = queryTag.push('OrderBy');
                    this.__order.forEach(function(order) {
                        camlOrder.push('FieldRef', {Name: order.field, Ascending: order.asc});
                    });
                }
            }
            var viewFields = camlView.push('ViewFields');
            this.__values.forEach(function(field) {
                viewFields.push('FieldRef', {Name: field});
            });
            if (this.__limit !== null) {
                camlView.push('RowLimit', {}, this.__limit);
            }
            return new SPList(this.__list).select(camlBuilder.build());
        };
		return (SelectQuery);
	}]);
@@ -1,17 +1,20 @@
 angular%0A
-%09
+    
 .module(
@@ -35,17 +35,20 @@
 Lists')%0A
-%09
+    
 .factory
@@ -298,128 +298,13 @@
 s.__
-limit = null;%0A            this.__order = %5B%5D;%0A            //this.__queries.where = %5B%5D;%0A            //this.__queries.limit
+order
  = %5B
@@ -449,17 +449,20 @@
         
-%09
+    
 this.__l
@@ -481,17 +481,20 @@
         
-%09
+    
 return t
@@ -1005,57 +1005,632 @@
 sh(%7B
-field: field, asc: asc%7D);%0A            return this
+column: field, asc: asc%7D);%0A            return this;%0A        %7D;%0A        SelectQuery.prototype.exec = function() %7B%0A            var builder = new CamlBuilder();%0A            var query = %7B%7D;%0A            if (typeof this.__values === 'object') %7B%0A                query.columns = this.__values;%0A            %7D%0A            if (angular.isDefined(this.__limit)) %7B%0A                query.limit = this.__limit;%0A            %7D%0A            if (angular.isDefined(this.__order)) %7B%0A                query.order = this.__order;%0A            %7D%0A            builder.buildFromJson(query);%0A            return new SPList(this.__list).read(builder.build())
 ;%0A  
@@ -3059,10 +3059,16 @@
  %7D;%0A
-%09%09
+        
 retu
@@ -3089,9 +3089,12 @@
 y);%0A
-%09
+    
 %7D%5D);

Use spaces