Quaternion.euler not rotating object more than 180 degrees

I am using a virtual joystick as aim for my top down shooter game and my character refuses to turn more than 180 degrees. When the rotation exceeds 180 it turns back towards 0 even though the rotation value still increase towards 360.

Here is my code:

	void LateUpdate () {

		Vector2 toVector = JSB.position - JS.position;
		float angelToTarget = Vector2.Angle (new Vector2 (0, -1), -toVector);
		Debug.Log (angelToTarget);
		Debug.Log (new Vector2 (0, 1));

		//float horizontal = -Input.GetAxis("Horizontal") * Time.deltaTime * playerSpeed;
		//float vertical = Input.GetAxis("Vertical") * Time.deltaTime * playerSpeed;
         // Disabled for testing
		if (SystemInfo.deviceType != DeviceType.Desktop) {
			if (GameObject.FindGameObjectWithTag ("GameController").GetComponent<ShopOpen> ().SOpen) {
				var mouse = Input.mousePosition;
				var screenPoint = Camera.main.WorldToScreenPoint (transform.localPosition);
				var offset = new Vector2 (mouse.x - screenPoint.x, mouse.y - screenPoint.y);
				var angle = Mathf.Atan2 (offset.y, offset.x) * Mathf.Rad2Deg;
				transform.rotation = Quaternion.Euler (0, 0, angle);	
			}

            //Disabled for testing
		} else if (SystemInfo.deviceType != DeviceType.Handheld) {
			if (angelToTarget != 90) {
				gameObject.transform.rotation = Quaternion.Euler (0, 0, angelToTarget);
			} else {
				gameObject.transform.rotation = Quaternion.Euler (0, 0, 90);
			}
		}
	}

I am getting the angel from the joystick using the vector 2 in the beginning and i am trying to set the rotation on my character to the same.

That’s because Vector2.Angle is not aware of your intention of a 360° circle. It’s measuring two vectors which could be oriented in any way and there’s no further than pointing in opposite directions.
I recommend using the Quaternion methods for the rotation. To me it looks like you want to have your gameobjects right facing right when the analogue stick faces down? (might be mistaking)
Anyway, it’s easier to do this for the rotation:

gameObject.transform.rotation = Quaternion.LookRotation(Vector3.forward, toVector);

Appologize if I’m not using the right directions. What this does is always point the gameobject z axis into the scene while rotating the y axis into the toVector direction. If that direction is off you can rotate it further by like 90° doing this:

toFoward = Quaternion.Euler(0,0,-90) * toForward;