Created
May 11, 2017 17:23
-
-
Save luis-puhl/dc31d8784ce99f8f612bc5bfd1d0b3d5 to your computer and use it in GitHub Desktop.
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
| import { Component, OnInit } from '@angular/core'; | |
| @Component({ | |
| selector: 'app-a', | |
| templateUrl: `<p> | |
| a works! | |
| </p> | |
| <app-b>app-b</app-b>`, | |
| styleUrls: [] | |
| }) | |
| export class AComponent implements OnInit { | |
| constructor() { } | |
| ngOnInit() { | |
| } | |
| } |
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
| import { NgModule } from '@angular/core'; | |
| import { CommonModule } from '@angular/common'; | |
| import { AComponent } from './a.component'; | |
| import { BModule } from './b/b.module'; | |
| @NgModule({ | |
| imports: [ | |
| CommonModule, | |
| BModule | |
| ], | |
| exports: [AComponent], | |
| declarations: [AComponent] | |
| }) | |
| export class AModule { } |
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
| import { Component } from '@angular/core'; | |
| @Component({ | |
| selector: 'app-root', | |
| templateUrl: `<h1> | |
| {{title}} | |
| </h1> | |
| <app-a>app-a</app-a>`, | |
| styleUrls: [] | |
| }) | |
| export class AppComponent { | |
| title = 'app works!'; | |
| } |
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
| import { BrowserModule } from '@angular/platform-browser'; | |
| import { NgModule } from '@angular/core'; | |
| import { FormsModule } from '@angular/forms'; | |
| import { HttpModule } from '@angular/http'; | |
| import { AModule } from './a/a.module'; | |
| import { AppComponent } from './app.component'; | |
| @NgModule({ | |
| declarations: [ | |
| AppComponent | |
| ], | |
| imports: [ | |
| BrowserModule, | |
| FormsModule, | |
| HttpModule, | |
| AModule | |
| ], | |
| providers: [], | |
| bootstrap: [AppComponent] | |
| }) | |
| export class AppModule { } |
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
| import { Component, OnInit } from '@angular/core'; | |
| @Component({ | |
| selector: 'app-b', | |
| templateUrl: `<p> | |
| b works! | |
| </p> | |
| `, | |
| styleUrls: [] | |
| }) | |
| export class BComponent implements OnInit { | |
| constructor() { } | |
| ngOnInit() { | |
| } | |
| } |
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
| import { NgModule } from '@angular/core'; | |
| import { CommonModule } from '@angular/common'; | |
| import { BComponent } from './b.component'; | |
| @NgModule({ | |
| imports: [ | |
| CommonModule | |
| ], | |
| exports: [BComponent], | |
| declarations: [BComponent] | |
| }) | |
| export class BModule { } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment