File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -8,10 +8,10 @@ component_re = re.compile('\.(?:controller|directive|service|factory|provider)\(
88DEFAULT_NAME = ' appName'
99DEFAULT_TYPE_NAME = ' type'
1010DEFAULT_COMPONENT_NAME = ' componentName'
11- READ_BYTES = 400
11+ CHECK_LINES = 20
1212
1313def bufText ():
14- return ' \n ' .join(vim.current.window.buffer[:2 ])
14+ return ' \n ' .join(vim.current.window.buffer[:CHECK_LINES ])
1515
1616def get_ng_component_of (snip ):
1717 text = bufText()
@@ -46,6 +46,12 @@ def get_ng_module(snip, **kwargs):
4646 snip.rv += DEFAULT_NAME
4747endglobal
4848
49+ snippet ngc " Define a new Angular Controller. You can change the controller name and parameters."
50+ var ${1: controllerName } = function(${2: \$ scope } , ${3: injectables } ) {
51+ $0
52+ };
53+ endsnippet
54+
4955snippet ngfor " angular.foreach loop"
5056angular.forEach(${1: iterateOver } , function(value, key) {
5157 $0
You can’t perform that action at this time.
0 commit comments