title: Uncaught (in promise) TypeError: Cannot read property 'ui5' of undefined
body: <p>When I try to create a BarChart in js view tab, it gives me this error.
  Here is my html code</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
          &lt;meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/&gt;
  
          &lt;link rel="stylesheet" type="text/css" href="Styles/MainPage.css"/&gt;
  
          &lt;script src="resources/sap-ui-core.js"
                  id="sap-ui-bootstrap"
                  data-sap-ui-libs="sap.m, sap.viz"
                  data-sap-ui-theme="sap_bluecrystal"&gt;
          &lt;/script&gt;
          &lt;!-- only load the mobile lib "sap.m" and the "sap_bluecrystal" theme --&gt;
  
          &lt;script&gt;
              sap.ui.localResources("empcrud");
              //sap.ui.localResources("Styles");
                  var app = new sap.m.App("AppId", { initialPage: "idEMainPage1" });
                  var page = sap.ui.view({ id: "idEmpDetails1", viewName: "empcrud.EmpDetails", type: sap.ui.core.mvc.ViewType.JS });
                  var page1 = sap.ui.view({ id: "idEMainPage1", viewName: "empcrud.MainPage", type: sap.ui.core.mvc.ViewType.JS });
                  var page2 = sap.ui.view({ id: "idGrafPage1", viewName: "empcrud.Grafik", type: sap.ui.core.mvc.ViewType.JS });
                  app.addPage(page).addPage(page1).addPage(page2);
                  app.placeAt("content");
          &lt;/script&gt;
  
      &lt;/head&gt;
      &lt;body class="sapUiBody" role="application"&gt;
          &lt;div id="content"&gt;&lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>And here is my view code where I use sap.viz.ui5</p>
  
  <pre><code>var oDataset = new sap.viz.ui5.data.FlattenedDataset({
          dimensions: [
              {
                  axis: 1, 
                  name: 'Uname',
                  value: "{Uname}"
              }
          ],
          measures: [
              {
                  name: 'Modno', 
                  value: '{Modno}'   
              },
          ],
          data: {
              path: "/results"
          }
  
      });
      var oBarChart = new sap.viz.ui5.Bar({
          width: "80%",
          height: "400px",
          plotArea: {
              //'colorPalette' : d3.scale.category20().range()
          },
          title: {
              visible: true,
              text: 'Modno Grafiği'
          },
          dataset: oDataset
      });
  </code></pre>
  
  <p>When I try to paste my view code in html script its works fine, also with xml view it works. I think its about the connection between js view and html. However view can not see sap.viz.Is there a way to define sap.viz in js or how can I overcome that? </p>
  
  <p>Thanks.</p>