Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8536205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:36:32+00:00 2026-06-11T10:36:32+00:00

Is there a way to evaluate a global resource using WinJS directly in my

  • 0

Is there a way to evaluate a global resource using WinJS directly in my WinJS control options definition, not using data-win-res attribute, because the specific option is a complex object?

Here is what I have:

<div id="CustomControl" data-win-control="My.Custom.NameSpace.Control" data-win-options="{
     opt1: 123,
     opt2: [
         { prop1: WinJS.Resources.getString('Global_Resource_String').value },
         ...
     }">
</div>

The following attempt to evaluate the resource crashes with an error that the interpreter expects a bracket but instead saw a left parentheses. You can see why I cannot easily generate a setter for this option and data-win-res="{ winControl: {opt2[0].prop1: "Global_Resource_String"} }" doesn’t work for me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T10:36:34+00:00Added an answer on June 11, 2026 at 10:36 am

    It turns out that inside the data-win-options attribute no function evaluation can be performed and thus the issue with evaluating global resources. If I want to assign a complex option to a global resource I need to do the function evaluation in a global variable and then assign to it like this:

    <script type="text/javascript">
        var resource = WinJS.Resources.getString('Global_Resource_String').value;
    </script>
    
    <div id="CustomControl" data-win-control="My.Custom.NameSpace.Control" data-win-options="{
         opt1: 123,
         opt2: [
             { prop1: resource },
             ...
         }">
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to evaluate a variable within a data option in a
Is there a way to evaluate the minimum requirements of a software? I mean,
Is there a way to to evaluate a boolean expression and assign its value
Is there a way to convince the C preprocessor to evaluate a transcendental function
Is there way to mute an audio stream or at least control the volume?
Is there any way to evaluate a string expression in XSL? example: <myItem id=1>
Is there a nice way to evaluate a regular expression range, say, for a
Is there a way to bulk evaluate the contents of an array in C++?
My manager tells me that there is a way to evaluate names that are
I would like to know if there was a secure way to evaluate mathematics

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.