We are tasked with finding the value of \( ab \), where \( x = 1 \) is a common root of the equations \( ax^2 + ax + 2 = 0 \) and \( x^2 + x + b = 0 \).
Step 1: Substitute \( x = 1 \) into both equations.
For the first equation \( ax^2 + ax + 2 = 0 \):
\[ a(1)^2 + a(1) + 2 = 0 \implies a + a + 2 = 0 \implies 2a + 2 = 0 \implies a = -1. \]
For the second equation \( x^2 + x + b = 0 \):
\[ (1)^2 + (1) + b = 0 \implies 1 + 1 + b = 0 \implies b = -2. \]
Step 2: Compute \( ab \).
\[ ab = (-1)(-2) = 2. \]
Final Answer: The value of \( ab \) is \( \mathbf{2} \), which corresponds to option \( \mathbf{(2)} \).