node.js - Use angular $parser on the server side in Node -
i'd use $parser module of angular inside open source library i'm maintaining. library templating engine .docx . benefit filtering functionality, , parser in general (+ operations, dot syntax)
what best way have access module. given library should work in nodejs?
i can specify parser this:
doc.parser=function(expression) { return {get:function(scope) {return scope[expression].touppercase() } }
the parser first param expression parse (for example user.name
), returns object function can call, in same philosophy $parser module. parser create demo parser shows can uppercase values of expression.
i'm seeking way say: doc.parser=$parser(), or this, , should work in nodejs , in browser.
i found file: https://raw.githubusercontent.com/angular/angular.js/master/src/ng/parse.js responsible parsing, needs $filter module, ...
you cannot use $parse method out of box angularjs
consider using angular expressions - want. , works on bot server , client side.
Comments
Post a Comment