DigitMagazine

Update app.component.ts file with nested components

Dec 17th, 2016
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. import { Component } from '@angular/core';
  2.  
  3. import { ChildComponent } from './child.component';
  4. @Component({
  5. selector: 'digit',
  6. styles : [`
  7. .parent {
  8. background : #c7c7c7;
  9. padding: 20px;
  10. }
  11. `],
  12. template: `
  13. <div class="parent">
  14. <h1>{{name}}</h1>
  15. <child-component></child-component>
  16. </div>
  17. `,
  18. directives : [ChildComponent]
  19. })
  20. export class AppComponent {
  21. name = "Parent Component"
  22. }
Add Comment
Please, Sign In to add comment