'Unresolved variable' about some variable used just one line above (PHPStorm 2018.2.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
add a comment |
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 '18 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 '18 at 13:18
add a comment |
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 '18 at 9:48
Gratz44Gratz44
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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 at 13:18
add a comment |
1 Answer
1
active
oldest
votes
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 |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
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 |
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 |
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 '18 at 13:22
Gratz44Gratz44
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.
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 '18 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 '18 at 13:18