angular.module('ysSmsVerification.services', []).service('smsService', ['$q',
	'$http', '$timeout', '$analytics',

	function($q, $http, $timeout,$analytics) {

		var smsService = {};


		var data = {
			phone_number: null,
			country_code: null,
			code: null
		}

		smsService.dataAttr = function(name, value) {
			if (value) {
				data[name] = value;
			} else {
				return data[name];
			}
		}

		// Send verification code to mobile
		// expects a phone number data.phone_number;
		smsService.send = function(num) {

			var deferred = $q.defer();

			// $timeout(function() {
			// 	deferred.resolve({
			// 		status: "ok"
			// 	});
			// }, 1000)
			var url = Yamsafer.urls.api + 'sms/create';
			$http.post(url, num).success(function(data, status, headers, config) {
				deferred.resolve(data);
			}).error(function(data, status, headers, config) {
				deferred.reject(data);
			});

			return deferred.promise;
		}

		// Verify code
		// expects code
		smsService.verify = function(postData) {

			var deferred = $q.defer();

			var url = Yamsafer.urls.api + 'sms/verify';
			$http.post(url, postData).success(function(data, status, headers, config) {

				if (status == 200) {
					deferred.resolve(data);
				}

				if (status.code == 400 || status.code == 500) {


					deferred.reject(data);
				}

			}).error(function(data, status, headers, config) {
				deferred.reject(data);
			});

			return deferred.promise;
		}

		return smsService;
	}
])
@@ -548,109 +548,8 @@
 );%0A%0A
-%09%09%09// $timeout(function() %7B%0A%09%09%09// %09deferred.resolve(%7B%0A%09%09%09// %09%09status: %22ok%22%0A%09%09%09// %09%7D);%0A%09%09%09// %7D, 1000)%0A
 %09%09%09v

fix bug