Skip to content

Commit b12bb0d

Browse files
Inserida mais um rota de navegação no app.routes e adicionada a chamada do componente na carrinho de pedidos
1 parent aede2fd commit b12bb0d

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

src/app/app.module.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { BrowserModule } from '@angular/platform-browser';
2-
import { NgModule } from '@angular/core';
2+
import { NgModule, LOCALE_ID } from '@angular/core';
33
import { HttpModule } from '@angular/http';
44
import { RouterModule } from '@angular/router';
55

@@ -18,6 +18,7 @@ import { ShoppingCartComponent } from './restaurant-detail/shopping-cart/shoppin
1818
import { MenuItemComponent } from './restaurant-detail/menu-item/menu-item.component';
1919
import { ReviewsComponent } from './restaurant-detail/reviews/reviews.component';
2020
import { ShoppingCartService } from './restaurant-detail/shopping-cart/shopping-cart.service';
21+
import { OrderComponent } from './order/order.component';
2122

2223

2324
@NgModule({
@@ -32,14 +33,15 @@ import { ShoppingCartService } from './restaurant-detail/shopping-cart/shopping-
3233
MenuComponent,
3334
ShoppingCartComponent,
3435
MenuItemComponent,
35-
ReviewsComponent
36+
ReviewsComponent,
37+
OrderComponent
3638
],
3739
imports: [
3840
BrowserModule,
3941
HttpModule,
4042
RouterModule.forRoot(ROUTES)
4143
],
42-
providers: [RestaurantService, ShoppingCartService],
44+
providers: [RestaurantService, ShoppingCartService, {provide: LOCALE_ID, useValue: 'pt-BR'}],
4345
bootstrap: [AppComponent]
4446
})
4547
export class AppModule { }

src/app/app.routes.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { RestaurantsComponent } from "./restaurants/restaurants.component";
55
import { RestaurantDetailComponent } from "./restaurant-detail/restaurant-detail.component";
66
import { MenuComponent } from "./restaurant-detail/menu/menu.component";
77
import { ReviewsComponent } from "./restaurant-detail/reviews/reviews.component";
8+
import { OrderComponent } from "./order/order.component";
89

910
export const ROUTES: Routes = [
1011
{path: '', component: HomeComponent},
@@ -15,6 +16,7 @@ export const ROUTES: Routes = [
1516
{path: 'menu', component: MenuComponent},
1617
{path: 'reviews', component: ReviewsComponent}
1718
]},
18-
{path: 'about', component: AboutComponent}
19+
{path: 'about', component: AboutComponent},
20+
{path: 'order', component: OrderComponent}
1921

2022
]

src/app/restaurant-detail/shopping-cart/shopping-cart.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ <h3 class="box-title">Carrinho</h3>
3636
<div class="box-footer" *ngIf="items().length">
3737
<div class="pull-right">
3838
<button (click)="clear()" type="button" class="btn btn-danger"><i class="fa fa-trash"></i> Limpar</button>
39-
<a href="order.html" class="btn btn-success"><i class="fa fa-credit-card"></i> Fechar Pedido</a>
39+
<a [routerLink]="['/order']" class="btn btn-success"><i class="fa fa-credit-card"></i> Fechar Pedido</a>
4040
</div>
4141
</div>
4242
</div>

src/polyfills.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ import 'core-js/es6/reflect';
1818
import 'core-js/es7/reflect';
1919
import 'zone.js/dist/zone';
2020

21+
import 'intl'
22+
import 'intl/locale-data/jsonp/pt-BR.js'

0 commit comments

Comments
 (0)