0

I want value of A*B.

I tried {A *}{B}, {A=A+B} and {A*B}. Its not working.

Can anyone please suggest what has to be done.

HenryDev
  • 4,685
  • 5
  • 27
  • 64
ABC
  • 212
  • 4
  • 16
  • Could you please post some parts of your code? Are you using the Angular parser? `{A*B}` should be working if A and B have a value, and if you are using the Angular parser. – Mario Varchmin Jan 21 '22 at 08:18

1 Answers1

0

If you enable the angular parser, like this, it should work :

var expressions = require("angular-expressions");
var assign = require("lodash/assign");
// define your filter functions here, for example
// to be able to write {clientname | lower}
expressions.filters.lower = function (input) {
    // This condition should be used to make sure that if your input is
    // undefined, your output will be undefined as well and will not
    // throw an error
    if (!input) return input;
    return input.toLowerCase();
};
function angularParser(tag) {
    tag = tag
        .replace(/^\.$/, "this")
        .replace(/(’|‘)/g, "'")
        .replace(/(“|”)/g, '"');
    const expr = expressions.compile(tag);
    return {
        get: function (scope, context) {
            let obj = {};
            const scopeList = context.scopeList;
            const num = context.num;
            for (let i = 0, len = num + 1; i < len; i++) {
                obj = assign(obj, scopeList[i]);
            }
            return expr(scope, obj);
        },
    };
}
new Docxtemplater(zip, { parser: angularParser });

https://docxtemplater.com/docs/angular-parse/

edi9999
  • 19,701
  • 13
  • 88
  • 127