And $A \cap B$ is a singleton set. Find the range of values for $a$.

Translate the text above into English, please keep the original text's line breaks and format, and output the translation result directly.
Parse and draw the graph of the function $y=|x+1|$, then discuss the position of the line $y=a x+2$. Using the graph, we can see: when $a \geqslant 1$, $A \cap B$ is a singleton set; when $-1<a<1$, $A \cap B$ is a two-element set; when $a \leqslant-1$, $A \cap B$ is also a singleton set.

The required range of $a$ is $(-\infty,-1] \cup[1, +\infty)$.