title: Can't invoke functions in cordova - visual studio
body: <p>I am creating first cordova app via visual studio cordova tools.<br/>
  I am using windows 7 and VS Community (if that is important) and ripple emulator.<br/>
  Problem is that I have code like this: <code>&lt;button onclick="showAlert(); return false;"&gt;Click Me&lt;/button&gt;</code> and my function is defined <code>in index.ts</code>.<br/>
  But I am getting error <code>Exception: showAlert is not defined</code> when click on button.<br/>
  What am I missing here?<br/>
  This is compelte code:<br/>
  index.html</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;title&gt;Cordova01&lt;/title&gt;
  
      &lt;!-- Cordova01 references --&gt;
      &lt;link href="css/index.css" rel="stylesheet" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;p&gt;Hello, your application is ready!&lt;/p&gt;
      &lt;p&gt;&lt;strong&gt;Hello, from Cordova :)&lt;/strong&gt;&lt;/p&gt;
      &lt;button onclick="showAlert(); return false;"&gt;Click Me&lt;/button&gt;
      &lt;!-- Cordova reference, this is added to your app when it's built. --&gt;
      &lt;script src="cordova.js"&gt;&lt;/script&gt;    
      &lt;script src="scripts/platformOverrides.js"&gt;&lt;/script&gt;
      &lt;script src="scripts/index.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>index.ts</p>
  
  <pre><code>module Cordova01 {
      "use strict";
  
      export module Application {
          export function initialize() {
              document.addEventListener('deviceready', onDeviceReady, false);
          }
  
          function onDeviceReady() {
              // Handle the Cordova pause and resume events
              document.addEventListener('pause', onPause, false);
              document.addEventListener('resume', onResume, false);
  
              // TODO: Cordova has been loaded. Perform any initialization that requires Cordova here.
  
          }
  
          function showAlert() {
              navigator.notification.alert(
                  "This is simple message!",  // message
                  null,       // callback
                  "Alert View Title", // title
                  'OK'        // buttonName
                  );    
          }
  
          function onPause() {
              // TODO: This application has been suspended. Save application state here.
          }
  
          function onResume() {
              // TODO: This application has been reactivated. Restore application state here.
          }
  
      }
  
      window.onload = function () {
          Application.initialize();
      }
  
  
  }
  </code></pre>