Comments (10)
Hi Jose,
Thank's for your encouragement.
Today scripts path works only for folder/files which are hosted inside an Eclipse project. I don't know if it's easy to implement script paths outside the given project. I must study that to see if it's possible to implement it.
Regards Angelo
from angularjs-eclipse.
@angelozerr So for now i made a copy of the js folder in common and im including it in my main project.
Now I have another problem, my directory structure looks like the following:
js
application
ExampleController.js
component
ComponentController.js
common
services
ApiService.js
If I inject and use ApiService from ExampleController.js, i get the expected completions, but if I do it from ComponentController, i get 0 suggestions, have you seen this before?
Thanks again
Jose
from angularjs-eclipse.
@angelozerr Just ran some more tests, and it seems to be because ComponentController.js is defined as angular.module("app.component") and ApiService is defined as angular.module("app"), so I guess you only get suggestions if the service belongs to that module.
Is there anyway to always get the suggestions?
from angularjs-eclipse.
Jose, it's very hard for me to understand your problem.
I suggest you that you create a simply project in your github which causes the problem. I could see in action your problem.
And please create a new issue if it's not the same problem than this issue.
Thank's
from angularjs-eclipse.
@angelozerr Here: https://github.com/josebalius/angularjsternmoduleexample
If you try to get suggestions for ApiService when using it in "SecondController" it doesn't work, but if you do it in "FirstController" it works because it belongs to the same module as the service, however as you can see in app.js, ApiService is also available to SecondController thus it should provide suggestions.
Let me know if it makes sense now, i threw this together very quickly before I left work.
Jose
from angularjs-eclipse.
I have tried your sample. You have :
angular.module("app.extra", []);
angular.module("app", ['app.extra']);
angular.module("app").service("ApiService", function() {
this.makeCall = function() {
return "You made a call";
};
});
angular.module("app").controller("FirstController", function($scope, ApiService) {
ApiService. // here Cttl+Space works
});
angular.module("app.extra").controller("SecondController", function($scope, ApiService) {
ApiService. // here Cttl+Space doesn't work
});
But are you sure that module dependencies are correct? If I write :
angular.module("app", []);
angular.module("app.extra", ['app']);
It works.
from angularjs-eclipse.
Hmm, I am not sure if mine or yours are correct. The way I originally wrote it still works with Angular (you can still use ApiService), and the way our app works is we bootstrap the main "app" module, which will have the different sub dependencies.
Like
angular.module('app.services', []);
angular.module('app.directives', []);
angular.module('app.controllers', []);
angular.module('app', ['app.services', 'app.directives', 'app.controllers'])
app.services, app.directives, and app.controllers all have access to anything defined under app.
If you look at the app.js example for the MEAN stack, you will see the same thing:
https://github.com/linnovate/mean/blob/master/public/js/app.js
This is an interesting problem for sure. Do we know which part of the plugin is making the decision whether to show suggestions or not based on the module name?
from angularjs-eclipse.
Do we know which part of the plugin is making the decision whether to show suggestions or not based on the module name?
You can find the tern plugin at https://github.com/angelozerr/tern.java/blob/master/core/tern.server.nodejs/node_modules/tern/plugin/angular.js This plugin is a fork of the original of tern project and, so it's difficult for me to tell you where you can change that. This plugin manage injection in the applyWithInjection
I will study this problem when I will have time.
from angularjs-eclipse.
Hi Jose, please reinstall AngularJS Eclipse. You will benefir with "Add Project" button in tern script path preferences. Please read https://github.com/angelozerr/tern.java/wiki/Tern-Script-Path#project---tern-script-path for more info.
I close this issue which is related to "external" project. If you have other problems, please create an other issue.
from angularjs-eclipse.
Wow, thank you @angelozerr I will be using this now :)
However for anything else that has an issue with the way their dependencies are declared, i created an extra JS file for Tern to load and simply did this:
var _oldModule = angular.module;
angular.module = function(name) {
return _oldModule('app');
};
So, all modules like angular.module("app.extra"), etc now get the suggestions from the 'app' module services. Read above if you want to see the history of the problem.
from angularjs-eclipse.
Related Issues (20)
- Run AS->protractor throws error client file cannot be empty. HOT 1
- Phonecat in AngularJS-Eclipse, and 'bower' HOT 2
- Why in my eclipse Node modules throwing error when i am installing protractor locally ?
- Missing documentation on how to expand HTML validation HOT 2
- Error when creating Angular2 project HOT 2
- hmmm...installed from marketplace but nothing changed... HOT 1
- Error when run test case
- Angular2 IDE Plugin Issue HOT 6
- Angular2 Eclipse HOT 1
- Problem with source hover popup and Dark theme
- Cannot find node install path node-native HOT 3
- Could Not find the required bundle org.eclipse.wst.html.core;bundle-version="1.2.0" HOT 1
- Can we Install Protractor in Elcipse
- Incorrect scope in Angular
- ng command not recognized in eclipse preference HOT 1
- Code completion does not work for Angular directives
- Unknown directive parameter for directive ng-md-icon
- Troubles installing any version of angularjs 1.3 or 1.2
- Using user-provided arguments in Protractor run configuration
- Unable to install the plugin in eclipse-oxygen javascript version
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angularjs-eclipse.