AngularJS代码片段
:page_with_curl: Sublime Text的Angular.js代码片段和完成补全
标签 代码片段
详细信息
安装次数
- 总数 96K
- Win 58K
- Mac 23K
- Linux 16K
Aug 6 | Aug 5 | Aug 4 | Aug 3 | Aug 2 | Aug 1 | Jul 31 | Jul 30 | Jul 29 | Jul 28 | Jul 27 | Jul 26 | Jul 25 | Jul 24 | Jul 23 | Jul 22 | Jul 21 | Jul 20 | Jul 19 | Jul 18 | Jul 17 | Jul 16 | Jul 15 | Jul 14 | Jul 13 | Jul 12 | Jul 11 | Jul 10 | Jul 9 | Jul 8 | Jul 7 | Jul 6 | Jul 5 | Jul 4 | Jul 3 | Jul 2 | Jul 1 | Jun 30 | Jun 29 | Jun 28 | Jun 27 | Jun 26 | Jun 25 | Jun 24 | Jun 23 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 2 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
Mac | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 |
Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
说明文件
Sublime Text的Angular.js代码片段
这个代码片段库提供了对Angular.js稳定和实验分支的补全。Sublime Text使用模糊搜索进行代码片段和补全,因此您不必完全编写触发器。所有代码片段都会自动添加Angular的依赖注入的行内符号,因此您不需要键入它们两次。
安装
- 软件包控制:安装“AngularJS代码片段”软件包
- 手动:将文件复制到您的Sublime Text用户文件夹
重要
除非您已将以下行添加到User.sublime-preferences,否则补全会显示在HTML中
"auto_complete_triggers": [ {"selector": "text.html", "characters": "<"}, {"selector": "text.html meta.tag", "characters": " " } ]
代码片段类别: - 服务 - 指令 - 全局 - jQuery lite - 作用域函数 - 日志函数 - 变量
服务
trigger | completion |
---|---|
config | config([function() { | }]) |
constant | constant('{name}', {value}) |
controller | controller('{Name}Ctrl', [function ({$scope}) { | }]) |
decorator | decorator('{name}', [function ($provide) { $provide.decorator('{name}', [function($delegate) { return {$delegate}|; }]); }]) |
directive | directive('{name}', [function () { return { restrict: '{A}', link: function(scope, iElement, iAttrs) { | } }; }]) |
directivelong | directive('{name}', [function () { return {| priority: 0, template: '<div></div>', templateUrl: 'directive.html', replace: true, transclude: true, restrict: 'A', scope: {}, controller: function($scope, $element, $attrs, $transclude, otherInjectables) { }, compile: function compile(tElement, tAttrs, transclude) { return function postLink(scope, iElement, iAttrs, controller) { } }, link: function postLink(scope, iElement, iAttrs) { } }; }]) |
factory | factory('{name}', [function () { | return { }; }]) |
otherwise | otherwise({ redirectTo: '/{route}' }) |
provider | provider('{name}', [function () { | this.$get = [function() { return { }; }]; }]) |
run | run([function() { | }]) |
service | service('{name}', [function () { | }]) |
value | value('{name}', {value}) |
when | when('/{name}', { templateUrl: '{name}.html', controller: '{Name}Ctrl' }) |
指令
trigger | completion |
---|---|
ng-animate | ng-animate=“{enter: ‘{example}-enter’, leave: ‘{example}-leave’}” |
ng-animates | ng-animate=“‘{class-prefix}’” |
ng-app | ng-app=“” |
ng-bind | ng-bind=“” |
ng-bind-html-unsafe | ng-bind-html-unsafe=“” |
ng-bind-template | ng-bind-template=“” |
ng-change | ng-change=“” |
ng-checked | ng-checked=“” |
ng-class | ng-class=“” |
ng-class-even | ng-class-even=“” |
ng-class-odd | ng-class-odd=“” |
ng-click | ng-click=“” |
ng-cloak | ng-cloak |
ng-controller | ng-controller=“{Name}Ctrl” |
ng-dblclick | ng-dblclick=“” |
ng-disabled | ng-disabled=“” |
ng-form | ng-form=“” |
ng-hide | ng-hide=“” |
ng-href | ng-href=“” |
ng-if | ng-if=“” |
ng-include | ng-include=“{template}” {onload=“” autoscroll=“”} |
ng-init | ng-init=“” |
ng-keydown | ng-keydown=“” |
ng-keypress | ng-keypress=“” |
ng-keyup | ng-keyup=“” |
ng-list | ng-list="" |
ng-model | ng-model="" |
ng-mousedown | ng-mousedown="" |
ng-mouseenter | ng-mouseenter="" |
ng-mouseleave | ng-mouseleave="" |
ng-mousemove | ng-mousemove="" |
ng-mouseover | ng-mouseover="" |
ng-mouseup | ng-mouseup="" |
ng-multiple | ng-multiple="" |
ng-nbind | ng-non-bindable="" |
ng-open | ng-open="" |
ng-pluralize | ng-pluralize count="" when="": ‘{}’“ |
ng-readonly | ng-readonly="" |
ng-repeat | ng-repeat="{item} in {array}" |
ng-selected | ng-selected="" |
ng-show | ng-show="" |
ng-src | ng-src="" |
ng-style | ng-style="" |
ng-submit | ng-submit="" |
ng-swipe-left | ng-swipe-left="" |
ng-swipe-right | ng-swipe-right="" |
ng-switch | ng-switch on="" |
ng-switch-default | ng-switch-default="" |
ng-switch-when | ng-switch-when="" |
ng-transclude | ng-transclude |
ng-view | ng-view |
全局变量
trigger | completion |
---|---|
angular.bind | angular.bind({self}, {function}) |
angular.bootstrap | angular.bootstrap({element}{, [{modules}]}) |
angular.copy | angular.copy({source}{, {destination}}) |
angular.element | angular.element({element}) |
angular.equals | angular.equals({obj1}, {obj2}) |
angular.extend | angular.extend({destination}, {source}) |
angular.forEach | angular.forEach({obj}, {iterator}) |
angular.fromJson | angular.fromJson({jsonString}) |
angular.identity | angular.identity() |
angular.injector | angular.injector([{modules}]) |
angular.isArray | angular.isArray({value}) |
angular.isDate | angular.isDate({value}) |
angular.isDefined | angular.isDefined({value}) |
angular.isElement | angular.isElement({value}) |
angular.isFunction | angular.isFunction({value}) |
angular.isNumber | angular.isNumber({value}) |
angular.isObject | angular.isObject({value}) |
angular.isString | angular.isString({value}) |
angular.isUndefined | angular.isUndefined({value}) |
angular.lowercase | angular.lowercase({string}) |
angular.module | angular.module('{moduleName}', []) |
angular.noop | angular.noop |
angular.toJson | angular.toJson({string}) |
angular.uppercase | angular.uppercase({string}) |
angular.version | angular.version |
jQuery lightweight
trigger | completion |
---|---|
angular: addClass | addClass({className}) |
angular: after | after({el}) |
angular: append | append({el}) |
angular: attr | attr({el}) |
angular: bind | bind({eventType}{, eventData}{, eventHandler}) |
angular: children | children() |
angular: clone | clone({withDataAndEvents}) |
angular: contents | contents({withDataAndEvents}) |
angular: css | css({propertyName(s)}) |
angular: data | data({key, value | obj}) |
angular: eq | eq({index}) |
angular: find | find({tag}) |
angular: hasClass | hasClass({className}) |
angular: html | html() |
angular: next | next() |
angular: parent | parent() |
angular: prepend | prepend({content}) |
angular: prop | prop({propertyName}) |
angular: ready | ready({handler}) |
angular: remove | remove({selector}) |
angular: removeAttr | removeAttr({attributeName}) |
angular: removeClass | removeClass({className}) |
angular: removeData | removeData({name}) |
angular: replaceWith | replaceWith({newContent}) |
angular: text | text() |
angular: toggleClass | toggleClass({className}) |
angular: triggerHandler | triggerHandler({eventType}) |
angular: unbind | unbind({eventType{, handler}) |
angular: val | val({eventType{, handler}) |
angular: wrap | wrap({wrappingElement}) |
angular: controller | controller({name}) |
angular: injector | injector() |
angular: scope | scope() |
angular: inheritedData | inheritedData() |
作用域函数
trigger | completion |
---|---|
angular: $apply | apply({exp}) |
angular: $broadcast | broadcast({name}{, args}) |
angular: $destroy | destroy() |
angular: $digest | digest() |
angular: $emit | emit({name}{, args}) |
angular: $eval | eval({expression}) |
angular: $evalAsync | evalAsync({expression}) |
angular: $new | new({isolate}) |
angular: $on | on({name}, {listener}) |
angular: $watch | watch({watchExpression}{, listener}{, objectEquality}) |
angular: $watchCollection | watchCollection({obj}, {listener}) |
angular: $id | id |
日志函数
trigger | completion |
---|---|
angular: $log.debug | log.debug('{debug}') |
angular: $log.error | log.error('{error}') |
angular: $log.info | log.info('{info}') |
angular: $log.log | log.log('{log}') |
angular: $log.warn | log.warn('{warning}') |
angular: $log.assertEmpty | log.assertEmpty() |
angular: $log.reset | log.reset() |
变量
trigger | completion |
---|---|
angular: $angular | angular |
angular: $anchorScroll | anchorScroll |
angular: $animation | animation |
angular: $animator | animator |
angular: $cacheFactory | cacheFactory |
angular: $compile | compile |
angular: $controller | controller |
angular: $exceptionHandler | exceptionHandler |
angular: $location | location |
angular: $locationProvider | locationProvider |
angular: $log | log |
angular: $parse | parse |
angular: $resource | resource |
angular: $rootElement | rootElement |
angular: $rootScope | rootScope |
angular: $route | route |
angular: $routeParams | routeParams |
angular: $routeProvider | routeProvider |
angular: $templateCache | templateCache |
angular: $timeout | timeout |
angular: $scope | scope |
授权协议
The MIT License (MIT)