Skip to content

Commit

Permalink
Demonstrating that going in and out of DemoComponent will repeat the …
Browse files Browse the repository at this point in the history
…data an extra time every time. Adding npm-shrinkwrap to clearly state the used modules
  • Loading branch information
steff1193 committed Oct 13, 2016
1 parent 76cb74c commit 317e697
Show file tree
Hide file tree
Showing 5 changed files with 616 additions and 3 deletions.
4 changes: 3 additions & 1 deletion client/imports/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<div>
<h1>Hello Angular2-Meteor!</h1>
<demo></demo>
<a routerLink="/demo" routerLinkActive="active">Demo</a>
<a routerLink="/demo2" routerLinkActive="active">Demo 2</a>
<router-outlet></router-outlet>
</div>
11 changes: 9 additions & 2 deletions client/imports/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouterModule } from '@angular/router';
import { AppComponent } from './app.component';
import { DemoComponent } from './demo/demo.component';
import { DemoDataService } from './demo/demo-data.service';
import { DemoComponent2 } from "./demo2/demo2.component";

@NgModule({
// Components, Pipes, Directive
declarations: [
AppComponent,
DemoComponent
DemoComponent,
DemoComponent2
],
// Entry Components
entryComponents: [
Expand All @@ -20,7 +23,11 @@ import { DemoDataService } from './demo/demo-data.service';
],
// Modules
imports: [
BrowserModule
BrowserModule,
RouterModule.forRoot([
{ path: 'demo', component: DemoComponent },
{ path: 'demo2', component: DemoComponent2 }
])
],
// Main Component
bootstrap: [ AppComponent ]
Expand Down
1 change: 1 addition & 0 deletions client/imports/app/demo2/demo2.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h2>Demo 2</h2>
10 changes: 10 additions & 0 deletions client/imports/app/demo2/demo2.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Component } from '@angular/core';

import template from './demo2.component.html';

@Component({
template
})
export class DemoComponent2 {
constructor() {}
}

0 comments on commit 317e697

Please sign in to comment.