Sublime Forum

angularJS snippet?

#1

Hi,
I just installed angularJS in Sublime Text 3, the I point the cursor for example in <html and click tab, nothing happened.
please advise if what I am doing is wrong or what .
thanks

0 Likes

#2

The current scoping requires a full tag like below:

<!doctype html>
<html |>
</html>

The following will not work:

<!doctype html>
<html |
0 Likes

#3

I did, it just duplicated the whole code :

0 Likes

#4

That output is not from the AngularJS package, that’s a (what I believe) a built-in ST 2 HTML snippet. I’m curious as to what are you expecting to happen when hitting tab at the end of html in the html tag?

0 Likes

#5

Yes it was an HTMl snippet, I just set the editor to HTML (from the bottom right), then typed <html + tab, the result was that html generated, than I went to after <html clicked tab, the whole code was duplicated, I am expecting to see ng-xxx directive for angularJS.
please correct me if I am wrong,
Thanks, your help is appreciated.

0 Likes

#6

Ah OK.

Don’t use tabs there, you should be using a space. Tabs will trigger snippets based on what word the cursor is at. After spacing away from the end of html you can pull up the completions via ctrl+space. If you’re using ST 3 just start typing, something like ng, and the completions will begin to show. In ST 2 there is mention of recommended settings here github.com/angular-ui/AngularJS … d-settings

0 Likes

#7

Thanks for your time,
I am using ST3
I tried Ctr Space, but I only got :

0 Likes

#8

I’d say the ng- completions are below those listed. Just start typing ng and ST will start filtering the completions out. Like… if you type ngdbl “ng-dblclick” should shoot to the top of the list.

0 Likes