The Dirac notation $\langle a | b \rangle$ seems somewhat ambiguous.
On one hand, it can be seen as inner product of elements $a(x)$ and $b(x)$ of the Hilbert space $\scr H$, namely: $$\langle a | b \rangle ={\displaystyle}\int_\mathbb R a^*(x) \ b(x) \ dx.\tag{1}$$
On the other hand, it's the evaluation of $b$ at its $a$th component, with respect to a particular orthonormal base for $\scr H$.
discrete case. $$\langle n | b\rangle = b_n, \tag{2d}$$ where $\displaystyle \sum_n |n\rangle\langle n | = \mathbb I\ $ and $\langle n | m \rangle = \delta_{nm}.$
continuous case. $$\langle x | b\rangle = b(x), \tag{2c}$$ where $\displaystyle \int_\mathbb R |x\rangle\langle x | = \mathbb I\ $ and $\langle x | x' \rangle = \delta(x- x').$
The obvious conclusion is that you are free to see $\langle a | b \rangle$ in both ways, that is, 1. and 2. are equivalent.
But it can't be! For instance:
$$b(x) \stackrel{(2c)}{=} \langle x | b\rangle \stackrel{(1)}{\neq} \displaystyle \int _\mathbb R x b(x) dx.\tag{3}$$
So? How can I choose the right way to see it a priori?