Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bdirito/c83c446660211ba359883fbf69d35d46 to your computer and use it in GitHub Desktop.
Save bdirito/c83c446660211ba359883fbf69d35d46 to your computer and use it in GitHub Desktop.
-- file: app.module --
// import browser etc
import { XModule } from './x.module'
@NgModule({
imports: [ ..., XModule ]
// entryComponents?
// bootstrap?
// something?
}) ...
-- file: x.module --
import { XComponent } from './x.component'
@NgModule({
declarations: [ XComponent ]
exports: [ XComponent ]
}) ...
-- file: x.component --
@Component({ ... }) export class XComponent ...
ng1module.directive('xThing', ng2adapter.downgradeNg2Component(XComponent))
-- file: index.html --
...
<body>
<ng1stuff>
<x-thing></x-thing>
</ng1stuff>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment