NOTE: This is a WebStorm issue, not an angular.js issue.
Screencast of the problem: http://f.cl.ly/items/302s0d1k1i3i1B2p0W09/ws703-angular-not-defined.mp4
Descr
Go to Settings > Plugins
and download the AngularJS plugin for WebStorm. That's the first thing I did before using AngularJS with WebStorm, and I never saw that issue.
Version 8 of WebStorm will have AngularJS fully baked in, but for now, that plugin should help.
Edit: Ok, I think I may have found another possible solution. As you said, it's a WebStorm issue. There is no actual error in the code, it's just a code inspection. You can turn off this inspection like this:
Go to settings > inspections > JavaScript > General
and uncheck "unresolved JavaScript variable"
and "unresolved JavaScript function"
.
This should make the error go away. I found this while going through an AngularJS tutorial on Pluralsight.