0

I have a UNC file path stored in a structure

scope.sites = [
    {
        id: 1,
        nickname: 'Development',
        sitepath: '\\SERVERA.mydomain.com\sites\panoply\wwwroot',
        active: true
    }
];

I want to display the sitepath in the tooltip, as such:

<label style="width:100%;font-size:10px;" title="{{target.sitepath}}">
    {{target.nickname}}
</label>

But as backslashes are escape characters what I get is \SERVERA.mydomain.comsitespanoplywwwroot.

I thought I could use {{target.sitepath.replace('\\', '\\\\')}} or {{target.sitepath.replace('\', '\\')}}.

But neither of those seem to work.

2 Answers 2

1

Unfortunately, what you're asking for isn't possible. This would have to be fixed when scope.sites is created since it's currently providing you with malformed JSON.

Sign up to request clarification or add additional context in comments.

Comments

1

Just escape each special character with '\' so :

 scope.sites = [
                {
                    id: 1,
                    nickname: 'Development',
                    sitepath: '\\\\SERVERA.mydomain.com\\sites\\panoply\\wwwroot',
                    active: true
                }

1 Comment

I am getting the values from sitepath. Not setting them

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.