3

I created new project and selected "Angular JS" as project type in webstorm.

Now webstorm has created a project for me like this:

enter image description here

I have added angular.js as a dependent javascript library.

When I open the index.html file, it has below code:

  <!-- In production use:
  <script src="//ajax.googleapis.com/ajax/libs/angularjs/x.x.x/angular.min.js"></script>
  -->
  <script src="bower_components/angular/angular.js"></script>
  <script src="bower_components/angular-route/angular-route.js"></script>
  <script src="app.js"></script>
  <script src="view1/view1.js"></script>
  <script src="view2/view2.js"></script>
  <script src="components/version/version.js"></script>
  <script src="components/version/version-directive.js"></script>
  <script src="components/version/interpolate-filter.js"></script>

The code is referring to angular js files which are present in folder called as bower_components, but the webstorm has not created any such folder automatically. Due to this when I created a file called app1.js and trying to write some angular js code the auto-completion is not working at all.

enter image description here

What is the correct way of creating the projects in webstorm for Angular JS?

Earlier I tried with creating a simple project rather than Angular Js project but still had issue with auto-completion. The details are given in this post : How to create a simple angular js project in webstorm

Update:

Thanks to Daniel, now the issue of bower components is solved. But still the auto-completion is not working when I try to do for code webstorm.controller, please see below screenshot, how can I fix this issue?

enter image description here

Community
  • 1
  • 1
learner
  • 6,062
  • 14
  • 79
  • 139
  • Have you ran 'bower install' yet? – dsgriffin Nov 19 '15 at 11:13
  • @deceze, both are different projects. One is created as a simple blank project and another as angular js project. – learner Nov 19 '15 at 11:14
  • @daniel, can you please tell me how do I install that? I am new to webstorm & angular js both. – learner Nov 19 '15 at 11:14
  • You need to download node.js, which comes with the npm package manager. Then you need to install bower via. npm, then run bower install – dsgriffin Nov 19 '15 at 11:16
  • @daniel, am using ubuntu machine, can you please help with the steps how can I do that? – learner Nov 19 '15 at 11:17
  • 3
    1. Install node (https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions), 2. run 'npm install -g bower', 3. run 'npm install' inside your project directory 4. run 'bower install' inside your project directory – dsgriffin Nov 19 '15 at 11:20
  • @daniel, Thanks a lot daniel, I am able to install `node js` and `bower`. But still the auto-complete feature is not working as expected, can you please tell me if there is any other setting that I need to do? The auto-complete for `angular.module` worked but when I started accessing the controller then there is no auto-complete option for it. – learner Nov 19 '15 at 12:20
  • run `bower install` in the project directory – Alexander Elgin Nov 19 '15 at 12:35
  • @AlexanderElgin, I already did that as per daniel's comment. – learner Nov 19 '15 at 12:53
  • @daniel, I am facing issue in windows machine when I run the `npm install` command, can you please take a look at my new post - http://stackoverflow.com/questions/33826245/failed-at-the-angular-seed0-0-0-postinstall-script-bower-install – learner Nov 20 '15 at 12:03

1 Answers1

1

Standard Angular methods completion doesn't currently work, please follow WEB-14134 for updates

lena
  • 90,154
  • 11
  • 145
  • 150
  • Thanks lena, I was thinking there is some problem with my configuration, I will follow the bug to see when it gets fixed. – learner Nov 19 '15 at 15:12