0

I start a project in angularjs, to learning about it by practice.

I insert to <html> this directive ng-app="ComplibaryApp" .

And of course include the js angular files. at the end of the <body>.

<script src="js/jquery-1.12.0.min.js"></script>
<script src="../dist/js/bootstrap.min.js"></script>
<script src="../lib/angular.min.js"></script>
<script src="app.js"></script>
<script src="js/factory.js"></script>
<script src="js/controllers.js"></script>

At the body i have : <div ng-view ></div>

Why at my files , conroller.js/config.js/factory.js , the module not recognized?

enter image description here

Moran
  • 435
  • 2
  • 6
  • 20
  • I believe that is just intelli-sense issue, I would also add a space between your `=angular`. What environment are you using? I think its just the IDE saying it can't find that function or module. – TheLazyChap Jan 25 '16 at 10:26
  • @TheLazyChap , I add a space, and still... I use Webstrom and i have the angular plugin. any idea? – Moran Jan 25 '16 at 11:03
  • are you using any JS linting tools such as `jshint`, `eslint` or `jslint` in your project? Take a look at this question and see if it helps http://stackoverflow.com/questions/21666090/webstorm-angular-is-not-defined that person had similar issue like yourself. Watch the screencast link of her problem to see if its the same. – TheLazyChap Jan 25 '16 at 11:29

2 Answers2

0

Is your Angular globally defined for your IDE ? Otherwise it won't recognise any of the angular functions.

on a side note, in your LoadData function you can just return the $http, this is also a promise (no need to create your own)

Martijn Welker
  • 5,575
  • 1
  • 16
  • 26
  • In other projects it works fine with angular. what you mean if my angular defined in my IDE ? I have the plugin Angular selected in my IDE. – Moran Jan 25 '16 at 10:50
0

You need to change the settings in Webstorm for either jshint or jslint, depending on which is turned on for you. In jslint, you can add a predefined for angular

MarkSh
  • 129
  • 1
  • 3