Skip to content

Commit ef02062

Browse files
Commit inicial da aplicação. No primeiro momento criadas as rotas necessárias para utilizar o menu principal. A constante ROUTES onde os componentes das rotas serão adicionados no componente principal app.component.html. Criados componentes de restaurante, individual e composto, criada uma interface com as informações do restaurante que será utilizada para recebe-las
1 parent dd2b662 commit ef02062

15 files changed

+12493
-28
lines changed

package-lock.json

Lines changed: 12269 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/about/about.component.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!-- INÍCIO DO CONTEÚDO -->
2+
<section class="content-header">
3+
<h1>Sobre</h1>
4+
</section>
5+
6+
<section class="content">
7+
<p class="lead">
8+
Meat | Aplicação que demonstra as features do Angular
9+
</p>
10+
<p class="lead">
11+
MIT license
12+
</p>
13+
<p class="lead">Copyright 2017 COD3R (<a href="http://www.cod3r.com.br">http://www.cod3r.com.br</a>)</p>
14+
<p class="lead">Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>
15+
<p class="lead">The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. </p>
16+
<p class="lead">
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
18+
<p class="lead">
19+
Imagens usadas na aplicação por <a href="http://www.freepik.com" target="_blank">freepik.com</a>
20+
</p>
21+
22+
</section>
23+
<!-- FIM DO CONTEÚDO -->

src/app/about/about.component.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { Component, OnInit } from '@angular/core';
2+
3+
@Component({
4+
selector: 'mt-about',
5+
templateUrl: './about.component.html'
6+
})
7+
export class AboutComponent implements OnInit {
8+
9+
constructor() { }
10+
11+
ngOnInit() {
12+
}
13+
14+
}

src/app/app.component.html

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,12 @@
11
<div class="wrapper">
22

3-
<!-- Início do header -->
4-
<header class="main-header">
5-
<nav class="navbar navbar-static-top">
6-
<div class="container">
7-
<div class="navbar-header">
8-
<a class="navbar-brand"><b>Meat</b></a>
9-
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
10-
<i class="fa fa-bars"></i>
11-
</button>
12-
</div>
13-
14-
<!-- Collect the nav links, forms, and other content for toggling -->
15-
<div class="collapse navbar-collapse pull-left" id="navbar-collapse">
16-
<ul class="nav navbar-nav">
17-
<li class="active"><a href="#">Restaurantes</a></li>
18-
<li><a href="#">Sobre</a></li>
19-
</ul>
20-
</div>
21-
<!-- /.navbar-collapse -->
22-
23-
</div>
24-
</nav>
25-
</header>
26-
<!-- Fim do header -->
3+
<mt-header></mt-header>
274

285
<!-- Full Width Column -->
296
<div class="content-wrapper">
307
<div class="container">
318

32-
{{content}}
9+
<router-outlet></router-outlet>
3310

3411
</div>
3512
</div>

src/app/app.module.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,28 @@ import { HttpModule } from '@angular/http';
44
import { RouterModule } from '@angular/router';
55

66

7-
import { AppComponent } from './app.component'
7+
import { AppComponent } from './app.component';
8+
import { HeaderComponent } from './header/header.component';
9+
import { HomeComponent } from './home/home.component';
10+
import { AboutComponent } from './about/about.component'
11+
import { ROUTES } from './app.routes';
12+
import { RestaurantsComponent } from './restaurants/restaurants.component';
13+
import { RestaurantComponent } from './restaurants/restaurant/restaurant.component';
814

915

1016
@NgModule({
1117
declarations: [
12-
AppComponent
18+
AppComponent,
19+
HeaderComponent,
20+
HomeComponent,
21+
AboutComponent,
22+
RestaurantsComponent,
23+
RestaurantComponent
1324
],
1425
imports: [
1526
BrowserModule,
1627
HttpModule,
17-
RouterModule
28+
RouterModule.forRoot(ROUTES)
1829
],
1930
providers: [],
2031
bootstrap: [AppComponent]

src/app/app.routes.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Routes } from "@angular/router";
2+
import { HomeComponent } from "./home/home.component";
3+
import { AboutComponent } from "./about/about.component";
4+
import { RestaurantsComponent } from "./restaurants/restaurants.component";
5+
6+
export const ROUTES: Routes = [
7+
{path: '', component: HomeComponent},
8+
{path: 'about', component: AboutComponent},
9+
{path: 'restaurants', component: RestaurantsComponent}
10+
]
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!-- Início do header -->
2+
<header class="main-header">
3+
<nav class="navbar navbar-static-top">
4+
<div class="container">
5+
<div class="navbar-header">
6+
<a [routerLink]="['']" class="navbar-brand"><b>Meat</b></a>
7+
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
8+
<i class="fa fa-bars"></i>
9+
</button>
10+
</div>
11+
12+
<!-- Collect the nav links, forms, and other content for toggling -->
13+
<div class="collapse navbar-collapse pull-left" id="navbar-collapse">
14+
<ul class="nav navbar-nav">
15+
<li routerLinkActive="active"><a [routerLink]="['/restaurants']">Restaurantes</a></li>
16+
<li routerLinkActive="active"><a [routerLink]="['/about']">Sobre</a></li>
17+
</ul>
18+
</div>
19+
<!-- /.navbar-collapse -->
20+
21+
</div>
22+
</nav>
23+
</header>
24+
<!-- Fim do header -->

src/app/header/header.component.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { Component, OnInit } from '@angular/core';
2+
3+
@Component({
4+
selector: 'mt-header',
5+
templateUrl: './header.component.html'
6+
})
7+
export class HeaderComponent implements OnInit {
8+
9+
constructor() { }
10+
11+
ngOnInit() {
12+
}
13+
14+
}

src/app/home/home.component.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!-- INÍCIO DO CONTEÚDO -->
2+
<section class="content-header">
3+
</section>
4+
5+
<section class="content">
6+
7+
<div class="jumbotron welcome-jumbotron">
8+
<h1>Bem vindo ao Meat!</h1>
9+
<p>
10+
Está com fome? Peça e receba em casa.
11+
</p>
12+
<a class="btn btn-primary btn-lg" [routerLink]="['restaurants']">Ver Restaurantes</a>
13+
</div>
14+
15+
</section>
16+
<!-- FIM DO CONTEÚDO -->

src/app/home/home.component.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { Component, OnInit } from '@angular/core';
2+
3+
@Component({
4+
selector: 'mt-home',
5+
templateUrl: './home.component.html'
6+
})
7+
export class HomeComponent implements OnInit {
8+
9+
constructor() { }
10+
11+
ngOnInit() {
12+
}
13+
14+
}

0 commit comments

Comments
 (0)