$$\vec L=m\vec r \times \vec v$$
The formula gives you the answer if you think about it. You could think of the vectors $\vec r$ and $\vec v$ in the following way:
The particle moves from A to B on a straight line. However you draw a position vector $\vec r$ to the point on the line from the origion $O$, all you are really interested is in the component of the position vector perpendicular to the velocity vector.
Here, the velocity vector $\vec v$ points along the same direction throughout its journey (along the line). If you draw a right angled triangle over the line :
In $\triangle OPC$, you can see that $OP$ is the side $rsin(\theta)$. And from that $\vec L$ turns out to be constant in both direction and magnitude.