# AmpersandJS Code Snippets [![JavaScript Style Guide](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) Snippets to create faster and better [AmpersandJS](https://ampersandjs.com/) JavaScript apps. ## Installation Use Sublime Text's [Package Control](https://sublime.wbond.net/installation) to install this plugin. ## Manual Installation Open up Terminal.app and execute these commands: ### Sublime Text 2 cd ~/Library/"Application Support"/"Sublime Text 2"/Packages/ git clone git@github.com:HSH/AmpersandJS-Sublime-Text-Snippets.git ### Sublime Text 3 cd ~/Library/"Application Support"/"Sublime Text 3"/Packages/ git clone git@github.com:HSH/AmpersandJS-Sublime-Text-Snippets.git ## Snippets To use a snippet, type the trigger codes (listed below in bold) then hit `tab` or `ctrl + enter`. *Remember*, you can press `tab` / `shift + tab` for speedy navigation from one part of the code to another. ### [Ampersand initialize](https://ampersandjs.com/docs/#ampersand-state-constructorinitialize) function **Trigger:** initialize ```xml initialize source.js, source.jsx, source.ts Ampersand initialize function ``` ### General [Ampersand-State](https://ampersandjs.com/docs/#ampersand-state-extend) extend **Trigger:** ampersandState ```xml ampersandState source.js, source.jsx, source.ts Ampersand State ``` ### [Ampersand derived property](https://ampersandjs.com/docs/#ampersand-state-derived) definition **Trigger:** deps ```xml deps source.js, source.jsx, source.ts derived property ``` ### [Ampersand props property](https://ampersandjs.com/docs/#ampersand-state-props) definition **Trigger:** prop ```xml prop source.js, source.jsx, source.ts State props property ``` ### General [Ampersand-Model](https://ampersandjs.com/docs/#ampersand-model-extend) extend **Trigger:** ampersandModel ```xml ampersandModel source.js, source.jsx, source.ts Ampersand Model ``` ### General [Ampersand-Rest-Collection](https://ampersandjs.com/docs/#ampersand-collection-extend) extend **Trigger:** ampersandCollection ```xml ampersandCollection source.js, source.jsx, source.ts Ampersand REST Collection ``` ### General [Ampersand-View](https://ampersandjs.com/docs/#ampersand-view-extend) extend **Trigger:** ampersandView ```xml ampersandView source.js, source.jsx, source.ts Ampersand View ``` ### Simple [Ampersand bindings](https://ampersandjs.com/docs/#ampersand-view-bindings) declaration **Trigger:** model. ```xml model. source.js, source.jsx, source.ts model binding property ``` ### [registerSubview](https://ampersandjs.com/docs/#ampersand-view-registersubview) function **Trigger:** registerSubview ```xml registerSubview source.js, source.jsx, source.ts registerSubview function ``` ### [render](https://ampersandjs.com/docs/#ampersand-view-render) function **Trigger:** render ```xml render source.js, source.jsx, source.ts render function ``` ### [renderCollection](https://ampersandjs.com/docs/#ampersand-view-rendercollection) function **Trigger:** renderCollection ```xml renderCollection source.js, source.jsx, source.ts renderCollection function ``` ### [renderSubview](https://ampersandjs.com/docs/#ampersand-view-rendersubview) function **Trigger:** renderSubview ```xml renderSubview source.js, source.jsx, source.ts renderSubview function ``` ### [renderWithTemplate](https://ampersandjs.com/docs/#ampersand-view-renderwithtemplate) function **Trigger:** renderWithTemplate ```xml renderWithTemplate source.js, source.jsx, source.ts renderWithTemplate function ``` ### [subviews](https://ampersandjs.com/docs/#ampersand-view-subviews) definition **Trigger:** subviews ```xml subviews source.js, source.jsx, source.ts subviews definition property ``` ### [save Model](https://ampersandjs.com/docs/#ampersand-model-save) definition **Trigger:** save ```xml save source.js, source.jsx, source.ts Save Ampersand Model ``` ### [fetch Model](https://ampersandjs.com/docs/#ampersand-model-fetch) definition **Trigger:** fetch ```xml fetch source.js, source.jsx, source.ts Fetch Ampersand Model ``` ### [destroy Model](https://ampersandjs.com/docs/#ampersand-model-destroy) definition **Trigger:** destroy ```xml destroy source.js, source.jsx, source.ts Destroy Ampersand Model ```