Created
May 11, 2017 17:30
-
-
Save luis-puhl/d94b4f3613991d984b1ede358feae459 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', | |
| template: `<p>a works!</p> | |
| <app-b>app-b</app-b>` | |
| }) | |
| 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', | |
| template: `<h1>{{title}}</h1> | |
| <app-a>app-a</app-a>` | |
| }) | |
| 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', | |
| template: `<p>b works!</p>` | |
| }) | |
| 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