AngularJS - Sublime Template for Hello World
Join the DZone community and get the full member experience.Join For Free
Following are the key points described later in this article:
- Why Sublime Snippet for AngularJS Hello World
- How to Create HelloNG Snippet?
- Code Samples
Why Sublime Snippet for AngularJS Hello World
Many a time, while starting on new AngularJS app for doing quick POC or testing purpose, I ended up creating boilerplate code or copied and pasted minimum AngularJS app code to get started. This boiler plate code consisted of following:
- Include Bootstrap CSS library
- Include core AngularJS library
- Write Angular JS module code
Above is demonstrated in the code below. As this seemed like a repetitive work, I went ahead and create a Sublime snippet and now I could use hellong auto-complete snippet as named in the code sample below, and create my quick AngularJS hello world and get started in no time.
How to Create HelloNG Sublime Snippet?
Following is how you could create and save the snippet such as that shown below:
- Paste the code below in a new file
- Save the file in a folder where all User created snippets are stored. If you are working on window, this could be typically found at c:\users\userName\AppData\Roaming\Sublime Text\Packages\User location.
- Once saved, go ahead and create a new file and save it as , say hello.html. Type hellong and press CTRL + Spacebar. That is it. You would see the code below printed there.
Isn’t that very useful?
Code Samples – Sublime Snippet for Hello World
Published at DZone with permission of Ajitesh Kumar, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.