vscode icon indicating copy to clipboard operation
vscode copied to clipboard

[html] Add support for Angular2

Open maliksahil opened this issue 10 years ago • 16 comments

Currently VSCode does not have support for Angular2. But it does seem to have prompts for Angular1. This makes writing Angular2 code difficult. For instance, when authoring a template for a component, if I wish to use *ngFor, I am prompted to pick Angular1 directives -

image

Also, VSCode is currently blind to Angular2 component semantics. It would be great if those showed up in intellisense, which would make composing applications a lot easier. This of course applies to more than just components.

I propose that support for Angular2 be added, and it should be implemented as an extension. So individual projects can pick and choose between Angular1 or Angular2.

maliksahil avatar Apr 04 '16 19:04 maliksahil

I think this is blocked on https://github.com/Microsoft/vscode/issues/2784

Tyriar avatar Apr 04 '16 22:04 Tyriar

I agree that better support would be awesome!

For now there are html and typescript snippets for angular2 that i wrote in the marketplace. https://marketplace.visualstudio.com/items?itemName=johnpapa.Angular2

Also, there is a request in user voice for auto imports. this would rock https://visualstudio.uservoice.com/forums/293070-visual-studio-code/suggestions/13344849-auto-imports-in-typescript

johnpapa avatar Apr 09 '16 12:04 johnpapa

It would be great if an extension could add that behavior. Extensions can already participate on code completions. They would have to do the same parsing as the HTML language mode to figure out at what location the user wants to complete.

aeschli avatar Apr 12 '16 07:04 aeschli

Intellisense, color schema and Emet already works in HTML, could you apply on template? For instance in Angular 2 if :

 template: `   ` 

pattern is recognized everything inside of should behave as HTML?

oodboo avatar May 05 '16 07:05 oodboo

@oodboo Is that in JavaScript? If yes, please file a separate issue for it. This bug is about improving the HTML support.

aeschli avatar May 06 '16 19:05 aeschli

I have just found #2000 which basically says the same thing ... so I do not know should I copy text there ...

oodboo avatar May 06 '16 19:05 oodboo

@oodboo #2000 looks like the right bug. Yes, add your example and suggestions there.

aeschli avatar May 06 '16 19:05 aeschli

So, no intellisense for angular 2 yet? I'm using the amazing @johnpapa snippets, but it would be great to have intellisense and autoimports for angular 2

jorgeas80 avatar Oct 03 '16 17:10 jorgeas80

Look for info here https://github.com/microsoft/typescript/issues/6508 and here https://github.com/angular/angular/issues/7482

stgolem avatar Oct 21 '16 19:10 stgolem

Yes, https://github.com/angular/angular/issues/7482 will provide great improvements for the Angular development experience in VSCode. Currently with the tslint plugin and codelyzer you can get warnings in inline templates/styles, for instance, for binding to private/missing properties or unused CSS.

mgechev avatar Oct 22 '16 04:10 mgechev

I am just creating angular 2 inline template It wold of being nice to autocorrelate dom events like if you type <button (mouse... expecting it will autocomplete with mouseover

kuncevic avatar Nov 10 '16 05:11 kuncevic

@kuncevic this is out of the scope of codelyzer but the language service that the Angular team is working on will provide such feature. Take a look at this talk by Misko Hevery from ng-europe. Soon will be released a VSCode extension which works together with the language service in order to provide autocompletion and much more.

mgechev avatar Nov 10 '16 05:11 mgechev

I have vs code installed but the variables of the class are not displayed in the template (html) of component, not intellisense, not show the variables, I have use angular 4 with snippets of john papa, have I install some extension?

alejandrohn avatar May 18 '17 20:05 alejandrohn

Here is extension which is still work in progress.

https://github.com/angular/vscode-ng-language-service

kukjevov avatar May 19 '17 04:05 kukjevov

Thanks, it really works

alejandrohn avatar May 19 '17 19:05 alejandrohn

Yes, this extension provides angular 2 support: https://marketplace.visualstudio.com/items?itemName=Angular.ng-template

mjbvz avatar Oct 12 '17 04:10 mjbvz