'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
yesterday
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
yesterday
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 yesterday
Gratz44
214
214
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
yesterday
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
yesterday
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
yesterday
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
yesterday
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
yesterday
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
yesterday
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
yesterday
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
yesterday
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
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
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
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
up vote
0
down vote
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 yesterday
Gratz44
214
214
add a comment |
add a comment |
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
yesterday
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
yesterday