title: DevExtreme - MyApp.app.navigation[x].option("badge", "x") not working
body: <p>I'm trying to create a badge on a slide out navigation item, but I can't seem to make it work.</p>
  
  <p>Basically I have a <em>Login</em> that can create <em>Hour Registrations</em>. These registrations needs to be either confirmed or denied by a <em>Login</em> with <em>Role_ID</em> = 1.</p>
  
  <p>After a <em>Login</em> has logged in (if <em>Role_ID</em> = 1), I pull out all of these <em>Hour Registrations</em> from my service, and then does this:</p>
  
  <pre><code>if (data.Role.Id === 1) {
                     HourRegistrationApplication.config.navigation[7].visible(true);
  
                     $.getJSON(baseAddress + "hours/head/" + data.Id,
                         function (hourRegArray) {
                             if (hourRegArray.length != 0) {
                                 console.log(hourRegArray.length);
                                 HourRegistrationApplication.app.navigation[7].option("badge", hourRegArray.length);
                             }
                         });
  
                 }
  </code></pre>
  
  <p>Where <code>hourRegArray</code> is the JSON that I return:</p>
  
  <pre><code>[
    {
      "ID": 1,
      "Hours": 5,
      "Date": "27/08/2015",
      "Comment": "Stackoverflow rocks",
      "Login_ID": 1
    },
    {
      "ID": 2,
      "Hours": 3,
      "Date": "25/08/2015",
      "Comment": "Stackoverflow rocks even more!",
      "Login_ID": 1
    }
  ]
  </code></pre>
  
  <p>Then I wish to have the value of <code>badge</code> to be the <code>hourRegArray.length</code>, but for some strange reason I get this error:</p>
  
  <blockquote>
    <p>0x800a138f - JavaScript runtime error: Invalid operand to 'in': Object expected</p>
  </blockquote>
  
  <p>What exactly is causing the problem here?</p>
  
  <p>I've made a support ticket on the DevExtreme support forum, and the support told me to update my project to the latest 15.1.6 (I think it is now), didn't make any difference, I get the same error.</p>