mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-24 14:31:41 +00:00
Simple project demonstrating ng2 component hosting within ng1-based application (based on official angular-seed repo).
20 lines
613 B
TypeScript
20 lines
613 B
TypeScript
/*
|
|
import {bootstrap} from 'angular2/platform/browser';
|
|
import {AppComponent} from './app.component';
|
|
|
|
bootstrap(AppComponent);
|
|
*/
|
|
|
|
import {UpgradeAdapter} from 'angular2/upgrade';
|
|
import {AppComponent} from './app.component';
|
|
import {AppNavBar} from "./components/ng2/navbar.component";
|
|
|
|
const upgradeAdapter = new UpgradeAdapter();
|
|
declare var angular: any;
|
|
|
|
angular.module('myApp')
|
|
.directive('myApp', upgradeAdapter.downgradeNg2Component(AppComponent))
|
|
.directive('appNavbar', upgradeAdapter.downgradeNg2Component(AppNavBar))
|
|
;
|
|
upgradeAdapter.bootstrap(document.body, ['myApp'], {strictDi: true});
|