Add scope accessors to a JS expression. For instance, "data.name" will become "$scope.data.name" if the scope has a field named 'data' NOTE using an instance function so this will be properly bound when used as a callback => https://github.com/Microsoft/TypeScript/wiki/'this'-in-TypeScript#use-instance-functions
the javascript from the angular view
new source with the scope accessors added
Generate a TS expression declaring a variable of
the type and value that you give. Will automatically call
addScopeAccessors
on the value.
typescript type for the variable
value for the variable
typescript expression that registers the variable, as string.
Get a new unique variable name
new unique variable name
You must register a variable name when you declare a variable
while generating code without going through [[generateVariable]]
or getNewVariableName.
Otherwise generation will add a $scope.
accessor to it even though
it shouldn't.
Since registerVariable
will return you the variable name you gave,
you can use this function as a pass-through, just wrap your var
name with this call.
Generated using TypeDoc
Companion object to assist typescript code generation. It manages the scope behind the scenes so its state changes as you call its methods. If you do not let it know about variables you declare in your typescript, there will be issues of '$scope.' being prepended to the generated code when it shouldn't be.