-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No intellisense when declaring function for angular components in IFFE #22
Comments
I have the same issue. Using IFFE to build angular applications is really promoted. So I can imagine more developers will run into the same issue. It will be great to have intellisense for it. |
That's odd. I use IIFE in every AngularJS project I build and I can get Intellisense. You definitely need a _references.js file that is set up similarly to how you have your scripts included in your outer HTML page. If that's not in place then you won't get Intellisense. |
Hi John, I spent this evening a lot of time to get rid off the issues with the intellisense. First I check a lot of stuff to check all javascript needed for intellisense is loaded in the correct order. I copied the example with the BarController as given by ChristianWeyer at the first post in the thread. I check the existence of the _references.js file and it was there. In addition I tested the intellisense for it with a plain function defined in one of the referenced files and that works well. The references to the angular works, too. E.q. angular.module().provider gives the help for the provider. This indicates the angular.intellisense.js is loaded. But I was still not able to got intellisense for the injected dependencies like services and constants. In the BarController example is that $scope and foo. I digged somewhat in the angular.intellisense.js and turn on the log to level VERBOSE and got the next output: As you can see the script breaks on creating the instance of the controller. Hope you have any suggestions. That's odd. I use IIFE in every AngularJS project I build and I can get Intellisense. You definitely need a _references.js file that is set up similarly to how you have your scripts included in your outer HTML page. If that's not in place then you won't get Intellisense. — |
All I can suggest at this point is that you upload/email your project (or a I'm certainly grateful for your interest in the project and I hope we can
|
I'm having the same problem in a Tools for Apache Cordova project in Visual Studio 2015. The one that I mentioned in issue #29. In this project I have all of my services, directives and controllers in separate files. There is no angular.module('myapp').controller('SomeCtrl', function (AlertService) {
AlertService.intellisenseWorksHere();
}); (AlertService resides in a separate file). However, if I do the following, I get no intellisense: /** @ngInject */
function SomeCtrl(AlertService) {
AlertService.doesNotGetIntellisenseHere();
}
SomeCtrl.$inject = ['AlertService'];
angular.module('myapp').controller('SomeCtrl', SomeCtrl); I'll be glad to send you a copy of my project, but it is a private project, so I can't attach it here. |
I have also tried using jsDoc |
I got this working by making a change similar to the one mentioned in issue #27. Importing my services module into my controllers module fixed everything. angular.module('myapp', [
'ionic',
'ngCordova',
'myapp.controllers',
'myapp.services'
])
.config(configureViews)
.run(runApp);
angular.module('myapp.controllers', [
'ionic',
'ngCordova',
'myapp.services' // adding this line fixed my issues.
]);
angular.module('myapp.services', [
'ionic',
'ngCordova'
]); My observation was in correct before. Intellisense was actually working for all classes in the same module (despite being in separate files). So my |
@waynebloss I believe the module issue has the same root cause as what is being tracked in #27. I'm closing this issue since I believe that one covers this problem. @ChristianWeyer and @fhrn71: if your problems aren't yet resolved then please request reopen and point to a sample project. |
Maybe this is related to the note from the README ("").
Our common pattern for registering functions with angular goes like this - here for a a service:
(function () {
"use strict";
})();
When I then use foo in my BarController:
(function () {
"use strict";
})();
In this case I do not get Intellisense for foo - in WebStorm this works, BTW.
Thanks!
The text was updated successfully, but these errors were encountered: