Z
Z
zwezew2019-03-11 12:07:10
JavaScript
zwezew, 2019-03-11 12:07:10

How to put a function in a balloon template?

var Custom = ymaps.templateLayoutFactory.createClass(
                '<div>' +
                    '<a href="tel:{{properties.phone}}">{{properties.phone}}</a>' + +
                '</div>'
            );

How to put properties.phone with a regular expression in a link?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem, 2019-03-11
@Cruper

var Custom = ymaps.templateLayoutFactory.createClass(
                '<div>' +
                    '<a href="tel:' + properties.phone + '">' + properties.phone +'</a>' +
                '</div>'
            );

Template String Syntax
var Custom = ymaps.templateLayoutFactory.createClass(
                '<div>' +
                    `<a href="tel:${properties.phone}">${properties.phone}</a>` +
                '</div>'
            );

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question