How to "escape" the @ in Razor

3

I'm trying to leave @ as a string. Here is the code:

hint: {
mentions: ['Pedro', 'Tiago', 'João', 'Maria'],
match: /\B@(\w*)$/, // Problema com @
search: function (keyword, callback) {
    callback($.grep(this.mentions, function (item) {
        return item.indexOf(keyword) == 0;
    }));
},
content: function (item) {
    return '@' + item;  // Problema com @
    }    
},

The marked lines face the problem of @.

The problem is @, it is understood as template syntax. How to leave it as a string?

    
asked by anonymous 12.12.2016 / 23:26

1 answer

4

Ironically (or not) who escapes @ is itself @ .

Using @@ should work.

    
12.12.2016 / 23:47