'Unresolved variable' about some variable used just one line above (PHPStorm 2018.2.5)
up vote
1
down vote
favorite
I'm struggling with my IDE with a simple code. I'm running under Angular 1.4, ES 5.1.
function myFunction() {
var vm = this;
vm.listResults = null;
SomeService.someFunction()
.then(function (result) {
vm.listResults = result;
if (vm.listResults.length > 0) {
vm.selectCity(vm.listResults[0]);
}
});
}
vm.selectCity = function (city) {};
The last if statement throws a warning and declares the vm.listResults
variable unresolved. Same for the call to selectCity
and its parameter. I can't CTRL+CLICK on those three and I don't really understand why.
What do I have to enabled in order to link this properly ?
Under Languages & Frameworks > Javascript > Libraries
I have angular-DefinitelyTyped
, HTML
& Node.js
Core checked and that's all.
And yes, I could disable the warnings but I'd rather not to, I really want to understand.
Thanks a lot for your help :)
javascript angularjs intellij-idea ide ecmascript-5
add a comment |
up vote
1
down vote
favorite
I'm struggling with my IDE with a simple code. I'm running under Angular 1.4, ES 5.1.
function myFunction() {
var vm = this;
vm.listResults = null;
SomeService.someFunction()
.then(function (result) {
vm.listResults = result;
if (vm.listResults.length > 0) {
vm.selectCity(vm.listResults[0]);
}
});
}
vm.selectCity = function (city) {};
The last if statement throws a warning and declares the vm.listResults
variable unresolved. Same for the call to selectCity
and its parameter. I can't CTRL+CLICK on those three and I don't really understand why.
What do I have to enabled in order to link this properly ?
Under Languages & Frameworks > Javascript > Libraries
I have angular-DefinitelyTyped
, HTML
& Node.js
Core checked and that's all.
And yes, I could disable the warnings but I'd rather not to, I really want to understand.
Thanks a lot for your help :)
javascript angularjs intellij-idea ide ecmascript-5
can't recreate using provided code snippet; please share a sample project that can be used to recreate the issue. Note that addingangular-DefinitelyTyped
to libraries doesn't enable angular support for your project, you need to includeangular.js
file (debug version, non-compressed) in your project
– lena
Nov 19 at 11:46
Adding angular.js file didn't solve the case but the project is kind of a complete library without main entry (just common controllers, directives, services, filters...). Adding the library into its own libraries solved my problem, I never thought about this oO
– Gratz44
Nov 19 at 13:18
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm struggling with my IDE with a simple code. I'm running under Angular 1.4, ES 5.1.
function myFunction() {
var vm = this;
vm.listResults = null;
SomeService.someFunction()
.then(function (result) {
vm.listResults = result;
if (vm.listResults.length > 0) {
vm.selectCity(vm.listResults[0]);
}
});
}
vm.selectCity = function (city) {};
The last if statement throws a warning and declares the vm.listResults
variable unresolved. Same for the call to selectCity
and its parameter. I can't CTRL+CLICK on those three and I don't really understand why.
What do I have to enabled in order to link this properly ?
Under Languages & Frameworks > Javascript > Libraries
I have angular-DefinitelyTyped
, HTML
& Node.js
Core checked and that's all.
And yes, I could disable the warnings but I'd rather not to, I really want to understand.
Thanks a lot for your help :)
javascript angularjs intellij-idea ide ecmascript-5
I'm struggling with my IDE with a simple code. I'm running under Angular 1.4, ES 5.1.
function myFunction() {
var vm = this;
vm.listResults = null;
SomeService.someFunction()
.then(function (result) {
vm.listResults = result;
if (vm.listResults.length > 0) {
vm.selectCity(vm.listResults[0]);
}
});
}
vm.selectCity = function (city) {};
The last if statement throws a warning and declares the vm.listResults
variable unresolved. Same for the call to selectCity
and its parameter. I can't CTRL+CLICK on those three and I don't really understand why.
What do I have to enabled in order to link this properly ?
Under Languages & Frameworks > Javascript > Libraries
I have angular-DefinitelyTyped
, HTML
& Node.js
Core checked and that's all.
And yes, I could disable the warnings but I'd rather not to, I really want to understand.
Thanks a lot for your help :)
javascript angularjs intellij-idea ide ecmascript-5
javascript angularjs intellij-idea ide ecmascript-5
asked Nov 19 at 9:48
Gratz44
234
234
can't recreate using provided code snippet; please share a sample project that can be used to recreate the issue. Note that addingangular-DefinitelyTyped
to libraries doesn't enable angular support for your project, you need to includeangular.js
file (debug version, non-compressed) in your project
– lena
Nov 19 at 11:46
Adding angular.js file didn't solve the case but the project is kind of a complete library without main entry (just common controllers, directives, services, filters...). Adding the library into its own libraries solved my problem, I never thought about this oO
– Gratz44
Nov 19 at 13:18
add a comment |
can't recreate using provided code snippet; please share a sample project that can be used to recreate the issue. Note that addingangular-DefinitelyTyped
to libraries doesn't enable angular support for your project, you need to includeangular.js
file (debug version, non-compressed) in your project
– lena
Nov 19 at 11:46
Adding angular.js file didn't solve the case but the project is kind of a complete library without main entry (just common controllers, directives, services, filters...). Adding the library into its own libraries solved my problem, I never thought about this oO
– Gratz44
Nov 19 at 13:18
can't recreate using provided code snippet; please share a sample project that can be used to recreate the issue. Note that adding
angular-DefinitelyTyped
to libraries doesn't enable angular support for your project, you need to include angular.js
file (debug version, non-compressed) in your project– lena
Nov 19 at 11:46
can't recreate using provided code snippet; please share a sample project that can be used to recreate the issue. Note that adding
angular-DefinitelyTyped
to libraries doesn't enable angular support for your project, you need to include angular.js
file (debug version, non-compressed) in your project– lena
Nov 19 at 11:46
Adding angular.js file didn't solve the case but the project is kind of a complete library without main entry (just common controllers, directives, services, filters...). Adding the library into its own libraries solved my problem, I never thought about this oO
– Gratz44
Nov 19 at 13:18
Adding angular.js file didn't solve the case but the project is kind of a complete library without main entry (just common controllers, directives, services, filters...). Adding the library into its own libraries solved my problem, I never thought about this oO
– Gratz44
Nov 19 at 13:18
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
So basically as I just replied, my project is like a big library commonly used by many of our other projects (common controllers / directives / services / filters...). It doesn't include angularjs in its package.json because this lib is just imported into projects that already load it, so I guess that's why it didn't work.
Adding this same library into its own libraries just solved my problems :)
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
So basically as I just replied, my project is like a big library commonly used by many of our other projects (common controllers / directives / services / filters...). It doesn't include angularjs in its package.json because this lib is just imported into projects that already load it, so I guess that's why it didn't work.
Adding this same library into its own libraries just solved my problems :)
add a comment |
up vote
0
down vote
accepted
So basically as I just replied, my project is like a big library commonly used by many of our other projects (common controllers / directives / services / filters...). It doesn't include angularjs in its package.json because this lib is just imported into projects that already load it, so I guess that's why it didn't work.
Adding this same library into its own libraries just solved my problems :)
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
So basically as I just replied, my project is like a big library commonly used by many of our other projects (common controllers / directives / services / filters...). It doesn't include angularjs in its package.json because this lib is just imported into projects that already load it, so I guess that's why it didn't work.
Adding this same library into its own libraries just solved my problems :)
So basically as I just replied, my project is like a big library commonly used by many of our other projects (common controllers / directives / services / filters...). It doesn't include angularjs in its package.json because this lib is just imported into projects that already load it, so I guess that's why it didn't work.
Adding this same library into its own libraries just solved my problems :)
answered Nov 19 at 13:22
Gratz44
234
234
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53371987%2funresolved-variable-about-some-variable-used-just-one-line-above-phpstorm-201%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
can't recreate using provided code snippet; please share a sample project that can be used to recreate the issue. Note that adding
angular-DefinitelyTyped
to libraries doesn't enable angular support for your project, you need to includeangular.js
file (debug version, non-compressed) in your project– lena
Nov 19 at 11:46
Adding angular.js file didn't solve the case but the project is kind of a complete library without main entry (just common controllers, directives, services, filters...). Adding the library into its own libraries solved my problem, I never thought about this oO
– Gratz44
Nov 19 at 13:18