GithubHelp home page GithubHelp logo

nativescript-ng2-vscode-snippets's Introduction

NativeScript + Angular Snippets for Visual Studio Code

Now compatible with Angular 4.x and above.

This JSON file contains snippets for all NativeScript UI components and some frequently used attributes specifically for use with nativescript-angular.

All UI components are prefixed with ns. Attributes do not have a prefix.

Preview

###UI Components

From within TypeScript Component Files:

  • Component with inline template - nscomponent_template
  • Component with templateUrl - nscomponent_templateUrl

The following can be used inside both TypeScript and HTML view files:

Layouts

  • Absolute Layout - nsabsolute
  • Dock Layout - nsdock
  • Flexbox Layout - nsflexbox
  • Grid Layout - nsgrid
  • Stack Layout - nsstack
  • Wrap Layout - nswrap

Widgets

  • Action Bar - nsactionbar
  • Action Bar with Back Button - nsactionbarback
  • Label - nslabel
  • Text Field - nstextfield
  • Secure Text Field (for passwords) - nspassword
  • Text View - nstextview
  • Image - nsimg
  • Border - nsborder
  • Button - nsbtn
  • Search Bar - nssearchbar
  • Switch - nsswitch
  • Slider - nsslider
  • Progress - nsprogress
  • Activity Indicator - nsloading
  • Date Picker - nsdate
  • Time Picker - nstime
  • List Picker - nslistpicker
  • Segmented Bar - nssegmentedbar
  • Tab View - nstabview
  • List View - nslistview
  • Web View - nswebview

###Attributes

  • cssClass - css
  • text - text
  • icon - icon
  • tap - tap
  • textWrap - wrap
  • horizontalAlignment - halign
  • verticalAlignment - valign
  • visibility - visibility
  • stretch - stretch
  • keyboardType - kbtype
  • colSpan - colspan
  • rowSpan - rowspan
  • row - row
  • col - col
  • width - width
  • height - height

How to use?

  1. Inside Visual Studio Code press

    CTRL + P
  2. Type the following in the console window

ext install nativescript-ng2-snippets
  1. Hit enter.

nativescript-ng2-vscode-snippets's People

Contributors

nathanwalker avatar sis0k0 avatar vjoao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nativescript-ng2-vscode-snippets's Issues

VSCode highlighting tags in red that it does not recognise

it appears this issue recently started, but here is a screenshot.

screen shot 2018-08-22 at 6 55 09 pm

It appears that the recognised tags such as label or button are ok, as well as any tag with a dash in it. Where as the nativescript ones are red or random gibberish tags will be red too. (this issue is not only present for the dark theme)

XML Self closing template parse error

Template parse errors:
Only void and foreign elements can be self closed "Label" ("[ERROR ->]

When using for example nslabel:
<Label text="App Component" color="white" textWrap="true" />

instead it has to be:
<Label text="App Component" color="white" textWrap="true" ></Label>

Auto-complete stops working periodically

In the example below the auto-complete worked fine for the outer StackLayout but then stopped working for the inner label:

                                <StackLayout>
                                    nslabel
                                </StackLayout>

This happens regularly. It works on one line but then stops on the next. The app is Nativescript with Angular using Kinvey. Versions listed below. Please let me know if you need any other info. This bug is rather distracting.

VSC Version: 1.38.1
Commit: b37e54c98e1a74ba89e03073e5a3761284e3ffb0
Date: 2019-09-11T13:31:32.854Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Darwin x64 18.7.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.