Last active
March 20, 2018 05:15
-
-
Save alexzuza/da48a6d59845c3d402c1d350a6bfb066 to your computer and use it in GitHub Desktop.
DI view parent element hierarhy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
selector: 'my-app', | |
template: `<my-list></my-list>` | |
}) | |
export class AppComponent {} | |
@Component({ | |
selector: 'my-list', | |
template: ` | |
<div class="container"> | |
<grid-list> | |
<grid-tile>1</grid-tile> | |
<grid-tile>2</grid-tile> | |
<grid-tile>3</grid-tile> | |
</grid-list> | |
</div> | |
` | |
}) | |
export class MyListComponent {} | |
@Component({ | |
selector: 'grid-list', | |
template: `<ng-content></ng-content>` | |
}) | |
export class GridListComponent {} | |
@Component({ | |
selector: 'grid-tile', | |
template: `...` | |
}) | |
export class GridTileComponent { | |
constructor(private gridList: GridListComponent) {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment