I've stripped out a lot of code but here is an example that I got to work:

main.ts

import { UpgradeAdapter } from '@angular/upgrade';
import { AppModule } from './app.module';

let upgradeAdapter = new UpgradeAdapter(AppModule);
angular.module('myApp')
.directive(
  'administration',
  upgradeAdapter.downgradeNg2Component(AdministrationComponent) as 
angular.IDirectiveFactory
);

upgradeAdapter.upgradeNg1Provider('Auth');  
upgradeAdapter.bootstrap(document.documentElement, ['

myApp

']);


index.html

<!doctype html>
<html lang="en">

<head>
   <base href="/">
   <meta charset="utf-8">
 <!-- Angular 1 app module -->
<script src="app.module.ng1.js"></script>
<!-- Configure System.js, our module loader -->
<script src="account/auth.module.js"></script>
<script src="account/auth.service.js"></script>
  <!-- angular 2 libraries -->
   <script src="../node_modules/core-js/client/shim.min.js"></script>
   <script src="../node_modules/zone.js/dist/zone.js"></script>
   <script src="../node_modules/reflect-metadata/Reflect.js"></script>
   <script src="../node_modules/systemjs/dist/system.src.js"></script>
   <!-- System JS loader -->
  <script src="/systemjs.config.js"></script>
   <script>
      System.import('main.js');
    </script><body>

<body class="container-fullwidth">
  <div autoscroll="true">

      <div ui-view=''>
        <i class="center-fix main-spinner fa fa-spin fa-spinner"></i>
      </div>

  </div>

</body>

</html>


app.module.ng1.js

'use strict';
// Define the `myApp` Angular 1 module
angular.module('myApp', [
  'ngAnimate',  'ngRoute',  'ui.router', 'ui.select', 'ngResource', 
'ngSanitize',   'myApp.auth'
])
.config(function ($stateProvider, $urlRouterProvider) {
.............
})
 .controller('TitlebarController', function () {
})
.directive('titlebar', function () {
  return {
    templateUrl: '/layout/titlebar.template.html',
    restrict: 'E',
    controller: 'TitlebarController',
    controllerAs: 'titlebar'
  }
}) 


Hopefully that helps guide you


-- 
You received this message because you are subscribed to the Google Groups 
"Angular" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to