Created
March 19, 2018 19:42
-
-
Save alexzuza/eb1bcaaf04443f9ebc484254d0b84026 to your computer and use it in GitHub Desktop.
DI simple application
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: `<child></child>`, | |
}) | |
export class AppComponent {} | |
@Component({ | |
selector: 'child', | |
template: `<grand-child></grand-child>` | |
}) | |
export class ChildComponent {} | |
@Component({ | |
selector: 'grand-child', | |
template: `grand-child` | |
}) | |
export class GrandChildComponent { | |
constructor(private service: Service) {} | |
} | |
@NgModule({ | |
imports: [BrowserModule], | |
declarations: [ | |
AppComponent, | |
ChildComponent, | |
GrandChildComponent | |
], | |
bootstrap: [AppComponent] | |
}) | |
export class AppModule { } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment