Skip to content

Commit

Permalink
Commit gothinkster#3
Browse files Browse the repository at this point in the history
  • Loading branch information
krizald committed Sep 13, 2018
1 parent e419416 commit ee95a49
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 11 deletions.
6 changes: 5 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ import {
import { AppRoutingModule } from './app-routing.module';
import { CoreModule } from './core/core.module';
import { StockModule } from './stock/stock.module';
import { FormsModule } from '@angular/forms';

@NgModule({
declarations: [AppComponent, FooterComponent, HeaderComponent],
imports: [
BrowserModule,
FormsModule,
CoreModule,
SharedModule,
HomeModule,
Expand All @@ -27,4 +29,6 @@ import { StockModule } from './stock/stock.module';
providers: [],
bootstrap: [AppComponent]
})
export class AppModule {}
export class AppModule {
private aaa = 11;
}
1 change: 1 addition & 0 deletions src/app/core/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ export * from './comment.model';
export * from './errors.model';
export * from './profile.model';
export * from './user.model';
export * from './stock.model';
9 changes: 9 additions & 0 deletions src/app/core/models/stock.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export class Stock {
constructor(public name?: string,
public ticker?: string,
public price?: number,
public prevPrice?: number,
public favorite?: boolean) {

}
}
2 changes: 1 addition & 1 deletion src/app/editor/editor.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, FormControl } from '@angular/forms';
import { FormBuilder, FormGroup, FormControl, NgModel } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';

import { Article, ArticlesService } from '../core';
Expand Down
1 change: 0 additions & 1 deletion src/app/stock/index.ts

This file was deleted.

4 changes: 0 additions & 4 deletions src/app/stock/stock-helper/Stock.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/app/stock/stock-helper/index.ts

This file was deleted.

16 changes: 16 additions & 0 deletions src/app/stock/stock-routing.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { StockComponent } from './stock.component';

const routes: Routes = [
{
path: '',
component: StockComponent
}
];

@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class StockRoutingModule {}
2 changes: 1 addition & 1 deletion src/app/stock/stock.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
stock works!
</p>
<form>
<div><input type="text" /></div>
<div><input type="text" name='stock' value="{{stock.price}}" /></div>
</form>
7 changes: 5 additions & 2 deletions src/app/stock/stock.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Component, OnInit } from '@angular/core';
import {FormControl,FormGroup} from '@angular/forms';
import { Component, OnInit, Input } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
import { Stock } from '../core/models';

@Component({
selector: 'app-stock',
Expand All @@ -8,9 +9,11 @@ import {FormControl,FormGroup} from '@angular/forms';
})
export class StockComponent implements OnInit {

@Input() public stock: Stock;
constructor() { }

ngOnInit() {
this.stock = new Stock('Apple', 'AAPL', 100, 110, false);
}

}
4 changes: 4 additions & 0 deletions src/app/stock/stock.module.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { NgModule } from '@angular/core';
import { StockComponent } from './stock.component';
import { StockService } from '../core';
import { StockRoutingModule } from './stock-routing.module';

@NgModule({
imports: [
StockRoutingModule
],
declarations: [
StockComponent
Expand All @@ -12,5 +14,7 @@ import { StockService } from '../core';
providers: [
StockService
]
,
exports: [ StockComponent ]
})
export class StockModule {}

0 comments on commit ee95a49

Please sign in to comment.