title: Using RequireJS with Angular 5
body: <p>Is there any guide anywhere to use Angular 5 with requireJS?
  I'm trying to insert an Angular5 app into an AngularJS ngView (route of route)</p>
  
  <p><strong>index.html</strong></p>
  
  <pre><code>&lt;div ng-if="showView" ng-view class="container"&gt;&lt;/div&gt;
  
      // routes
      $routeProvider
          .when("/home", {
              templateUrl: "views/home.html",
              controller: "mainController",
              controllerAs: "main",
              resolve: {
                  dummy: function ($rootScope) {
                      require(["angular_ctrl"], function () {
                          console.info("HOME DEPS LOADED!!");
                          $rootScope.showView = true;
                      });
                  }
              }
          })
          //ANGULAR 5 CONTENT
          .when("/delivery", {
              templateUrl: "_delivery/dist/delivery.html",
              resolve: {
                  dummy: function ($rootScope) {
                      $rootScope.showView = true;
                  }
              }
          })
          .otherwise({
              redirectTo: "/home"
          });
  </code></pre>
  
  <p>The issue I'm facing is that if I leave the generated angular5 index as is, <strong>the app is fine the first time I enter the delivery route</strong>, but from the second time I get the following error:</p>
  
  <blockquote>
    <p>zone already loaded</p>
  </blockquote>
  
  <p>So I created <strong>_delivery/dist/delivery.html</strong> (instead of _delivery/dist/index.html) with the following content:</p>
  
  <pre><code>&lt;base href=""&gt;
  &lt;app-root&gt;&lt;/app-root&gt;
  
  &lt;script type="text/javascript"&gt;
      var angularFiveDeps = [
          "_delivery/dist/inline.bundle.js",
          "_delivery/dist/polyfills.bundle.js",
          "_delivery/dist/styles.bundle.js",
          "_delivery/dist/vendor.bundle.js",
          "_delivery/dist/main.bundle.js"
      ];
  
      require(angularFiveDeps, function () {
          console.info("DELIVERY DEPS LOADED!!");
  
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>But I get the following error</p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'call' of undefined</p>
  </blockquote>
  
  <p>Thank you</p>