• This repository has been archived on 25/May/2019
  • Stars
    star
    1,422
  • Rank 31,892 (Top 0.7 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 11 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

AngularJS code completion, snippets, go to definition, quick panel search, and more.

AngularJS Sublime Text Package

Installation Options

  • Package Control
  • Download this repo, rename it to 'AngularJS', and place it within your Packages folder. This can be found within Sublime Text at Preferences > Browse Packagesโ€ฆ
  • Clone the repo into your Packages folder git clone git://github.com/angular-ui/AngularJS-sublime-package.git AngularJS

Recommended Settings

Update your User Settings to the following. This setting update will automatically open the completion list for HTML attributes. You can add scopes for other preprocessor to get the list to automatically show.

(this is currently a ST3 default)

// Controls what scopes auto complete will be triggered in)
"auto_complete_selector": "source - comment, meta.tag - punctuation.definition.tag.begin"

(this is currently a ST3 default, sans 'text.haml')

// For haml you could add
"auto_complete_selector": "source - comment, meta.tag - punctuation.definition.tag.begin, text.haml"
// add for auto triggering controller completions within the ng-controller=""
"auto_complete_triggers":
	[
		{
			"characters": "ng-controller=\"*",
			"selector": "punctuation.definition.string"
		}
	]

Keymaps

super+ctrl+l

If not indexed: Indexes current project; If indexed: Opens quick panel with a list of definitions to search through [command: angularjs_find]

super+ctrl+alt+l

Attempts to goto definition (project must be indexed first) [command: angularjs_go_to_definition]

super+shift+ctrl+l

Attempts to open browser to directive documentation at current cursor location [command: angularjs_go_to_documentation]


notice

The above keymaps could be used by other plugins as well, so, you my need to remap them via Preferences > Key Bindings - User

To check if another plugin is using the above keymaps all you have to do is open the ST console (ctrl+`) and write out sublime.log_commands(True) and that will log all the commands ran in ST.


Command Palette

  • AngularJS: Rebuild Search Index
  • AngularJS: Delete Cache
  • AngularJS: Prune Cache (removes missing files from index)
  • AngularJS: Look Up Definition
  • AngularJS: Toggle - Disable All Completions
  • AngularJS: Toggle - Disable Indexed Directive Completions
  • AngularJS: Toggle - Disable Indexed Isolate Completions
  • AngularJS: Toggle - Disable Built-in Directive Completions
  • AngularJS: Toggle - Disable Built-in Element Completions
  • AngularJS: Toggle - Disable JS Completions
  • AngularJS: Toggle - Enable data- Prefix

Completion Options

Preferences > Package Settings > AngularJS > Completions - User

You can use the following properties to either extend or override the default completions provided.

extended_attribute_list: []; Allows you to extend the plug-in with more attributes

angular_elements: [*]; Default list of directives that can be used as HTML elements

filter_list: [*]; Default list of filters

core_attribute_list: [*]; Default list of filters

[*] - Adding any of these properties to your User file will override all default values for that setting

Example Completions - User

{
	"extended_attribute_list":[
		["my-directive\tMy Directives", "my-directive=\"${1:string}\"$0"],
	]
}

Checkout the default completions settings (Preferences > Package Settings > AngularJS > Completions - Default) to see more examples.

Completion Settings

Preferences > Package Settings > AngularJS > Settings - User

js_scope: "source.js - string.quoted - comment - meta.brace.square"; Scope to return JS completions in

filter_scope: "text.html string.quoted"; Scope to return filters in

js_prefixes: [","]; add characters that you want to prevent completion triggers

disable_all_completions: false,

disable_indexed_directive_completions: false; bare-bones completion of any directives that have been index

disable_indexed_isolate_completions: false; attempts to provide isolate scope completions when a directive is used as an element

disable_default_directive_completions: false;

disable_default_element_completions: false;

disable_default_js_completions: false;

enable_data_prefix: bool (false); adds the 'data-' prefix to attribute completions, note that you must still type 'ng-' to get autocompletion-list

Example Settings - User, enable "data-" prefix

{
	"enable_data_prefix": true
}

Indexing Options

Preferences > Package Settings > AngularJS > Settings - User (requires project to be re-indexed)

The regex that's used for look up expects the definitions to start like one of the the following examples:

filter('interpolate', ['version', function(version) { ...

.filter('interpolate', ['version', function(version) { ...

('chained').filter('interpolate', ['version', function(version) { ...

/**
 *  If you use something other than `app` as a variable name
 *  you will need to update the `match_expressions` setting
 *  and change `app` to some other name.
 */
app.filter('interpolate', ['version', function(version) { ...

angular.module('myApp', [])

you can change app to some other name if you need to

match_expression: "((^[ \\\\t]*\\.{0}|^[ \\\\t]*{0}|angular\\.{0}|\\)\\.{0}|app\\.{0})[ ]*\\([ ]*[\"\\'])([\\w\\.\\$]*)([\"\\'])"

if you want to match against a group of names change app to (app|somethingElse|foo) and bump the following setting to 4

match_expression_group: 3

match_definitions: ["controller", "directive", "module", "factory", "filter"]; Determines what type of definitions to index

excluded_dirs: ["node_modules/"]; Global setting for excluding folders

exclude_file_suffixes: ["min.js", "angular.js"]; exclude files via their suffix

Excluding Folders Per Project

You can exclude folders at the project level by opening your project settings file Project > Edit Project

Example:

"settings":
    {
        "AngularJS":
        {
            "exclude_dirs": ["someFolder/*/lib/angular/*"]
        }
    }

Including Folders Per Project

You can override the default project folders by setting the AngularJS folders variable within your projects settings Project > Edit Project

Example:

{
	"folders":
	[
		{
			"follow_symlinks": true,
			"path": "/Users/username/Projects/example"
		}
	],
	"settings": {
		"AngularJS": {
			"folders": [
				"/Users/username/Projects/example/ng/src",
				"/Users/username/Vendors/someother/lib/outside/of/project"
			]
		}
	}
}

You can use 'shell-like' wildcards within your folder paths, they're expanded via the glob module.

Quick Panel Options

Preferences > Package Settings > AngularJS > Settings - User (Sublime Text 3 Only)

show_file_preview: bool(true); As you type, the current file and definition will be shown in the buffer

Example Settings - User, hide file preview

{
	"show_file_preview": false
}

Plug-in Details

Syntax File

Provides a syntax file, HTML (Angular.js), that you can set to your view which adds the HTML scope back to <script type="text/ng-template"> tags.

Completions

Provides auto-completion of core AngularJS directives, such as ng-repeat, ng-click, as well as any custom directives you create.

The following completions require you to index your project

(Index your project via super+ctrl+l)

Provides auto-completions for any directive as an HTML element, prefixed with ngDir to easily find via fuzzy search.

Provides isolate scope completions (with binding types hinted on the right) specific to any directive used as an element, prefixed with isolate to easily find via fuzzy search.

You can also get completions for filters within HTML markup. Trigger the completions list via ctrl+space right after typing | (pipe plus a space) and you should find all your filters that have been indexed within the completion list.

Provides controller completions when the cursor is within the double quotes of ng-controller="". You can have this triggered automatically via the settings provided in the 'Recommending Settings' section

Goto Definition

Once you have your project indexed you can use the keyboard shortcut super+alt+ctrl+l when your cursor is within directive/services/etc.. and you'll be transported to the file that contains the definition.

Quick Panel Definition Look Ups

Quickly find your directives/filters/modules/factories via the quick_panel. Once your project has been indexed, by either executing the command 'AngularJS: Rebuild Search Index' from the command palette or executing the shortcut super+ctrl+l to open the quick_panel search for the first time.

Each time you save a file that file will be reindexed, if you have already triggered indexing, so that the quick_panel search stays up-to-date.

Javascript Completions

Global Context
  • angular - angular
  • $animate - $animate
  • $animateProvider - $animateProvider
  • $cacheFactory - $cacheFactory(cacheId[, options])
  • $compile - $compile(element, transclude, maxPriority)
  • $compileProvider - $compileProvider
  • $controller - $controller(constructor, locals)
  • $controllerProvider - $controllerProvider
  • $exceptionHandler - $exceptionHandler(exception[, cause])
  • $exceptionHandlerProvider - $exceptionHandlerProvider
  • $filter - $filter(name)
  • $filterProvider - $filterProvider
  • $http - $http
  • $httpBackend - $httpBackend
  • $injector - $injector
  • $interpolate - $interpolate(text[, mustHaveExpression, trustedContext])
  • $interpolateProvider - $interpolateProvider
  • $interval - $interval
  • $locale - $locale
  • $location - $location
  • $locationProvider - $locationProvider
  • $log - $log
  • $logProvider - $logProvider
  • $parse - $parse(expression)
  • $parseProvider - $parseProvider
  • $provide - $provide
  • $q - $q
  • $rootElement - $rootElement
  • $rootScope - $rootScope
  • $rootScopeProvider - $rootScopeProvider
  • $sce - $sce
  • $sceDelegate - $sceDelegate
  • $sceDelegateProvider - $sceDelegateProvider
  • $sceProvider - $sceProvider
  • $scope - $scope
  • $templateCache - $templateCache
  • $timeout - $timeout
  • $window - $window
  • $cookies - $cookies
  • $cookieStore - $cookieStore
  • $resource - $resource(url[, paramDefaults, actions])
  • $route - $route
  • $routeParams - $routeParams
  • $routeProvider - $routeProvider
  • $sanitize - $sanitize(html)
  • $swipe - $swipe
Context Specific
  • angular

    • bind
    • bootstrap
    • copy
    • element
    • equals
    • extend
    • forEach
    • fromJson
    • identity
    • injector
    • isArray
    • isDate
    • isDefined
    • isElement
    • isFunction
    • isNumber
    • isObject
    • isString
    • isUndefined
    • lowercase
    • mock
    • module
    • noop
    • toJson
    • uppercase
    • version
  • $animate

    • addClass
    • enter
    • leave
    • move
    • removeClass
  • $animateProvider

    • classNameFilter
    • register
  • $compileProvider

    • aHrefSanitizationWhitelist
    • directive
    • imgSrcSanitizationWhitelist
  • $controllerProvider

    • register
  • $exceptionHandlerProvider

    • mode
  • $filterProvider

    • register
  • $http

    • delete
    • get
    • head
    • jsonp
    • post
    • put
    • defaults
    • pendingRequests
  • $httpBackend

    • expect
    • expectDELETE
    • expectGET
    • expectHEAD
    • expectJSONP
    • expectPATCH
    • expectPOST
    • expectPUT
    • flush
    • resetExpectations
    • verifyNoOutstandingExpectation
    • verifyNoOutstandingRequest
    • when
    • whenDELETE
    • whenGET
    • whenHEAD
    • whenJSONP
    • whenPOST
    • whenPUT
  • $injector

    • annotate
    • get
    • has
    • instantiate
    • invoke
  • $interpolateProvider

    • endSymbol
    • startSymbol
  • $interval

    • cancel
    • flush
  • $locale

    • id
  • $location

    • absUrl
    • hash
    • host
    • path
    • port
    • protocol
    • replace
    • search
    • url
  • $locationProvider

    • hashPrefix
    • html5Mode
  • $log

    • debug
    • error
    • info
    • log
    • warn
    • assertEmpty
    • reset
  • $logProvider

    • debugEnabled
  • $parseProvider

    • logPromiseWarnings
    • unwrapPromises
  • $provide

    • constant
    • decorator
    • factory
    • provider
    • service
    • value
  • $q

    • all
    • defer
    • reject
    • when
  • $rootScope, $scope

    • $apply
    • $broadcast
    • $destroy
    • $digest
    • $emit
    • $eval
    • $evalAsync
    • $new
    • $on
    • $parent
    • $root
    • $watch
    • $watchCollection
    • $id
  • $rootScopeProvider

    • digestTtl
  • $sce

    • getTrusted
    • getTrustedCss
    • getTrustedHtml
    • getTrustedJs
    • getTrustedResourceUrl
    • getTrustedUrl
    • parse
    • parseAsCss
    • parseAsHtml
    • parseAsJs
    • parseAsResourceUrl
    • parseAsUrl
    • trustAs
    • trustAsHtml
    • trustAsJs
    • trustAsResourceUrl
    • trustAsUrl
    • isEnabled
  • $sceDelegate

    • getTrusted
    • trustAs
    • valueOf
  • $sceDelegateProvider

    • resourceUrlBlacklist
    • resourceUrlWhitelist
  • $sceProvider

    • enabled
  • $timeout

    • cancel
    • flush
  • $cookieStore

    • get
    • put
    • remove
  • $route

    • reload
    • current
    • routes
  • $routeProvider

    • otherwise
    • when
  • $swipe

    • bind
  • mock

    • dump
    • module
  • events

    • $locationChangeStart
    • $locationChangeSuccess
    • $destroy
    • $includeContentLoaded
    • $includeContentRequested
    • $routeChangeError
    • $routeChangeStart
    • $routeChangeSuccess
    • $routeUpdate
    • $viewContentLoaded
  • attrs

    • $addClass
    • $observe
    • $removeClass
    • $set
    • $updateClass
    • $attr
verbose

verbose_$http

$http('GET|POST|PUT|DELETE', url, post, function(status, response){
  // success
}, function(status, response){
  // error
});

verbose_$filter

$filter('currency|date|filter|json|limitTo|linky|lowercase|number|orderBy|uppercase')(array, expression);

verbose_$interval

$interval(fn, delay, count, invokeApply)

verbose_$timeout

$timeout(function(){
  
}, delay);

verbose_directive

directive('', ['', function(){
  // Runs during compile
  return {
    // name: '',
    // priority: 1,
    // terminal: true,
    // scope: {}, // {} = isolate, true = child, false/undefined = no change
    // controller: function($scope, $element, $attrs, $transclude) {},
    // require: 'ngModel', // Array = multiple requires, ? = optional, ^ = check parent elements
    // restrict: 'A', // E = Element, A = Attribute, C = Class, M = Comment
    // template: '',
    // templateUrl: '',
    // replace: true,
    // transclude: true,
    // compile: function(tElement, tAttrs, function transclude(function(scope, cloneLinkingFn){ return function linking(scope, elm, attrs){}})),
    link: function($scope, iElm, iAttrs, controller) {
      
    }
  };
}]);

verbose_module

/**
*  Module
*
* Description
*/
angular.module('', []).
providers

config

config(['',function() {
  
}])

constant

constant('name', value)

controller

controller('name', ['', function(){
  
}])

factory

factory('name', ['', function(){
  return function name(){
    
  };
}])

run

run('name', ['', function(){
  
}])

service

service('name', ['', function(){
  
}])

value

value('name', value)

More Repositories

1

bootstrap

PLEASE READ THE PROJECT STATUS BELOW. Native AngularJS (Angular) directives for Bootstrap. Smaller footprint (20kB gzipped), no 3rd party JS dependencies (jQuery, bootstrap JS) required. Please read the README.md file before submitting an issue!
JavaScript
14,347
star
2

ui-router

The de-facto solution to flexible routing with nested views in AngularJS
TypeScript
13,611
star
3

ui-grid

UI Grid: an Angular Data Grid
JavaScript
5,386
star
4

ui-select

AngularJS-native version of Select2 and Selectize
JavaScript
3,278
star
5

angular-google-maps

AngularJS directives for the Google Maps Javascript API
CoffeeScript
2,530
star
6

angular-ui-OLDREPO

DISCONTINUED REPO: This project has been restructured ->
JavaScript
2,210
star
7

ui-calendar

A complete AngularJS directive for the Arshaw FullCalendar.
JavaScript
1,494
star
8

ui-utils

Deprecated collection of modules for angular
JavaScript
1,443
star
9

ui-sortable

jQuery UI Sortable for AngularJS
JavaScript
1,265
star
10

ui-select2

AngularJS wrapper for select2 (deprecated, use angular-ui/ui-select)
JavaScript
594
star
11

ui-ace

This directive allows you to add ACE editor elements.
JavaScript
580
star
12

ui-tinymce

AngularUI wrapper for TinyMCE
JavaScript
490
star
13

ui-layout

This directive allows you to split !
JavaScript
410
star
14

ui-mask

Mask on an input field so the user can only type pre-determined pattern
JavaScript
393
star
15

ui-codemirror

This directive allows you to add CodeMirror to your textarea elements.
JavaScript
383
star
16

ui-grid.info

Website for ui-grid
377
star
17

ui-scroll

Unlimited bidirectional scrolling over a limited element buffer for AngularJS applications
JavaScript
324
star
18

ui-leaflet

AngularJS directive to embed an interact with maps managed by Leaflet library
JavaScript
316
star
19

AngularJS-StyleGuide

Example of scalable architecture for my NG-Conf 2014 talk
JavaScript
287
star
20

ui-map

Google Maps
JavaScript
285
star
21

AngularJS-Atom

An AngularJS package for Github's Atom editor
CoffeeScript
285
star
22

ui-date

jQuery UI Datepicker for AngularJS
JavaScript
266
star
23

ui-slider

jQuery UI Slider for AngularJS
HTML
265
star
24

AngularJS-brackets

AngularJS plugin for Brackets (booya)
JavaScript
217
star
25

bootstrap-bower

This is a bower repository to hold Angular UI Bootstrap releases.
JavaScript
158
star
26

alias

Create concise aliases for third-party directives and templates
JavaScript
115
star
27

ui-mention

Facebook-like @mentions for text inputs built around composability
JavaScript
115
star
28

ui-validate

General-purpose validator for ngModel
JavaScript
111
star
29

ui-chart

This directive lets you use jqPlot with Angular
JavaScript
111
star
30

ui-uploader

Customizable file uploader
JavaScript
108
star
31

ui-tour

A native tour-type directive that will lace easily-controllable tooltips throughout your app
HTML
94
star
32

AngularJs.tmbundle

AngularJs Textmate Bundle
87
star
33

angular-ui.github.com

Angular UI homepage
HTML
80
star
34

bower-ui-grid

Bower package for UI Grid
JavaScript
39
star
35

ui-scrollpoint

Add a 'ui-scrollpoint' class to elements when the page scrolls past them.
JavaScript
29
star
36

ui-event

Bind a callback to any event not natively supported by Angular
JavaScript
28
star
37

AngularJS-tern-plugin

A, slow'ish moving, WIP plugin for Tern that enables it to understand AngularJS dependency injection.
JavaScript
26
star
38

community

Placeholder repo for discussion
24
star
39

angular-ui-publisher

Helper component for building and publishing your angular modules as bower components
JavaScript
20
star
40

ui-leaflet-draw

angular directive for ui-leaflet to utilize Leaflet.Draw
CoffeeScript
16
star
41

ui-indeterminate

Toggle a checkbox input's special 'indeterminate' property
JavaScript
14
star
42

angular-ui-router-bower

Bower publishing for Angular UI-Router for ng1
14
star
43

ui-calendar2

Angular Native Calendar, inspired by ui-calendar
JavaScript
13
star
44

angular-ui-docs

Helper component for building your angular modules as bower components
JavaScript
10
star
45

ng-grid-legacy

ng-grid 2.x
JavaScript
5
star
46

builder

Build server for angular-ui
JavaScript
3
star
47

ui-position

Helper class used by a lot of angular projects on the web
1
star