ng-typeview
Advanced tools
Comparing version 0.0.16 to 0.0.17
@@ -140,2 +140,29 @@ "use strict"; | ||
}; | ||
var ngBlur = { | ||
forAttributes: ["ng-blur"], | ||
handleAttribute: function (attrName, attrValue, codegenHelpers) { | ||
return { source: "const " + codegenHelpers.getNewVariableName() + " = (" + codegenHelpers.registerVariable('$event') + ": any) => " + | ||
codegenHelpers.addScopeAccessors(attrValue) + ";" }; | ||
} | ||
}; | ||
var ngModelOptions = { | ||
forAttributes: ["ng-model-options"], | ||
handleAttribute: function (attrName, attrValue, codegenHelpers) { | ||
var typeDef = "{updateOn?: string, debounce?: number," + | ||
"allowInvalid?: boolean, getterSetter?: boolean, timezone?: string}"; | ||
return { source: codegenHelpers.declareVariable(typeDef, attrValue) }; | ||
} | ||
}; | ||
var ngPattern = { | ||
forAttributes: ["ng-pattern"], | ||
handleAttribute: function (attrName, attrValue, codegenHelpers) { | ||
return { source: codegenHelpers.declareVariable("RegExp|string", attrValue) }; | ||
} | ||
}; | ||
var ngGrid = { | ||
forAttributes: ["ng-grid"], | ||
handleAttribute: function (attrName, attrValue, codegenHelpers) { | ||
return { source: codegenHelpers.declareVariable("any", attrValue) }; | ||
} | ||
}; | ||
// ng-switch should work on the attribute level, but the spec requires to read | ||
@@ -262,3 +289,4 @@ // multiple attributes at once... Eg "on" | ||
ngBindAttrDirectiveHandler, | ||
ngRepeatAttrDirectiveHandler, ngOptions]; | ||
ngRepeatAttrDirectiveHandler, ngOptions, ngBlur, | ||
ngModelOptions, ngPattern, ngGrid]; | ||
/** | ||
@@ -265,0 +293,0 @@ * Set of angular tag directives supported out of the box. You can give this |
@@ -242,3 +242,4 @@ "use strict"; | ||
ts.SyntaxKind.FalseKeyword, | ||
ts.SyntaxKind.UndefinedKeyword]); | ||
ts.SyntaxKind.UndefinedKeyword, | ||
ts.SyntaxKind.RegularExpressionLiteral]); | ||
function stmtAddScopeAccessors(scopes) { | ||
@@ -245,0 +246,0 @@ return function (node) { |
@@ -33,4 +33,5 @@ "use strict"; | ||
assertScopeAcc("{name: $scope.wasProvidedWorkbook}", "{name: wasProvidedWorkbook}"); | ||
assertScopeAcc("/^[a-z]+$/", "/^[a-z]+$/"); | ||
}); | ||
}); | ||
//# sourceMappingURL=view-ngexpression-parser.js.map |
{ | ||
"name": "ng-typeview", | ||
"version": "0.0.16", | ||
"version": "0.0.17", | ||
"description": "library to enable type-checking of angular views when using typescript", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -41,3 +41,4 @@ import * as assert from 'assert' | ||
assertScopeAcc("{name: $scope.wasProvidedWorkbook}", "{name: wasProvidedWorkbook}"); | ||
assertScopeAcc("/^[a-z]+$/", "/^[a-z]+$/"); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
183624
2486