Guest User

Untitled

a guest
Jul 15th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. import { bootstrapModule } from '../lib/bootstrap-module';
  2. import { Component } from '../lib/component';
  3.  
  4. const rootComponent: Component = {
  5. name: 'root-component',
  6. template: `<div>
  7. Root Component
  8. <br><br><br>
  9. <sub-component></sub-component>
  10. <sub-sub-component></sub-sub-component>
  11. </div>`,
  12. beforeStart: () => console.log(this),
  13. };
  14.  
  15. const subComponent: Component = {
  16. name: 'sub-component',
  17. template: `<div>
  18. SubComponent
  19. <br>
  20. <br>
  21. <sub-sub-component>
  22. </sub-sub-component>
  23. </div>`,
  24. beforeStart: () => console.log('lifecycle hook'),
  25. };
  26.  
  27. const subSubComponent: Component = {
  28. name: 'sub-sub-component',
  29. template: '<div>SUBSUBCOMPONENT</div>',
  30. };
  31.  
  32. export const startApp = () =>
  33. bootstrapModule({
  34. rootComponent: rootComponent,
  35. components: [rootComponent, subComponent, subSubComponent],
  36. });
Add Comment
Please, Sign In to add comment