- This topic has 5 replies, 4 voices, and was last updated 7 years, 6 months ago by support-swapna.
-
AuthorPosts
-
JamesParticipantFirst of all, I’m loving Angular IDE. Thanks for all the hard work you guys have been putting into the project.
I seem to be running into a problem, though, but I’m not sure if it’s because I haven’t configured things correctly. Basically, I’m trying to get Webclipse to add imports for me automatically, but I’m having mixed results. This is a TypeScript project, using AngularJS.
To show the problem, I’ve created a package.json file, with the following dependencies:
"dependencies": { "angular": "1.6.4" }, "devDependencies": { "@types/angular": "1.6.15" }
Then in the file: foo.ts, I add the following code:
let myPromise: IPromise<string>;
…then the IDE tells me: “Cannot find name ‘IPromise'”
But if add the import for angular, it does what I expect:
Cannot find name 'IPromise'. 1 quick fix available: Import 'IPromise' from 'angular'
I’ve uploaded a video so you can see the problem I’m experiencing:
I’ve also added my project to github:
https://github.com/jalbr74/import-testMy thinking was that dependencies would be resolved in the project using package.json, so I could auto-import these dependencies as I need them.
Am I going about this the wrong way?Thanks,
James
support-piotrParticipantJames,
Thank you for a very detailed demo of the problem! This looks definitely like a bug on our side and I’ll be glad to fix it. I am adding it to my TODO list 🙂 It’s awesome to hear that you love Angular IDE! Thanks for all of your bug reports 🙂
Best regards,
Piotr Tomiak
JamesParticipantAwesome, thank you.
Yeah, I’ve used Eclipse for 15 years on my Java projects, but in the last couple of years my career has switched over to Angular development. So I tried using WebStorm for the last six months, but kept wishing I had a way to do Angular and node development in Eclipse. So when I found Webclipse/Angular IDE, I was glad you guys had a solution for my situation.
So thanks again!
James
support-tonyKeymasterJames,
This is now fixed in the latest release, CI 5. Please go to Help->Webclipse->Check for Updates and follow the wizard to install them. Let us know if you see any problems.
JamesParticipantHi, I have verified it now imports properly ‘Injectable’ from angular properly, thank you.
However, I am still seeing a problem with resolving ambiguity, when the type exists in more than one location. For example, given the following code:
import { } from 'ng-metadata/core'; import { } from 'angular'; @Injectable() export class SsprService { }
If I use the “quick fix” feature to add the import, I end up with:
import { Injectable } from 'angular';
… when I want to end up with:
import { Injectable } from 'ng-metadata/core';
I would have expected to be prompted for the right one to import, since it exists in two different places.
Thanks,
James
support-swapnaModeratorJames,
I have filed a bug for the dev team to fix the import issue when the type exists in more than one location.
Thank you for raising it. Sorry for inconvenience caused.–Swapna
MyEclipse Support -
AuthorPosts