The simple approach is to measure the distance linearly as if they were Euclidian:
$d^2(\theta,\phi)=\sum_i(\phi_i-\theta_i)^2$.
You must handle cases like $\theta_i=359$ and $\phi_i=1$, where the distance must be 2 not 358, of course. Handling angles linearly can make sense, the circumference is linear on angles.
The other way is with cosine:$$d^2(\theta,\phi)=\sum_i(1-\cos(\phi_i-\theta_i))^2$$
You can make this even fancier
$$d^2(\theta,\phi)=\sum_i\left(\frac{1-\cos(\phi_i-\theta_i)}{1+\cos(\phi_i-\theta_i)}\right)^2$$
This distance goes to infinity when the phase difference is near 180, which maybe what you want depending on your application.
Note that in the above approaches the circularity is only addressed at the vector component level, then the distance to entire vector is calculated as in Euclidian space. This may not be what you want.
Consider this example: you have a vector in space and the angles are components representing its direction, maybe gyroscope angles. Now the real distance from one such vector to another is a projection of one vector onto another.
Then the angle (distance) is $$d(\phi,\theta)=1+\sum_i\cos\phi_i\times\cos\theta_i $$
This is an example where the distance metric is dictated by the application. Also it is the case where the set of all possible vectors $\phi,\theta$ is not a full Euclidian space $\mathbf R^3$ but a subset where the squared sum of cosines should add up to 1 for each vector:$$\sum_i\cos^2\phi_i=1$$
In these cases Euclidian distance is usually not the best because the straight line from one vector to another will likely leave the subspace of possible vectors and go through areas of impossible vectors.
You have to consider what are your angle vectors exactly, not just the circularity, but whether the set of possible vectors forms manifold or subspace in Euclidian space. This will inform you on what are the suitable distance metrics.