Skip to content

Commit 19ee7aa

Browse files
author
Lazhari
committed
Fixing the common issue on app module and index page
1 parent 055ffc4 commit 19ee7aa

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

src/app/app.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<app-header [title]="title"></app-header>
22

33
<div class="container">
4-
<app-users [users]="users"></app-users>
4+
<router-outlet></router-outlet>
55
</div>

src/app/app.component.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import { Component } from '@angular/core';
2-
import { USERS } from './mock-users';
2+
33
@Component({
44
selector: 'app-root',
55
templateUrl: './app.component.html',
66
styleUrls: ['./app.component.css']
77
})
88
export class AppComponent {
99
title: string = 'CONTACT MANAGER';
10-
users = USERS;
1110
}

src/app/app.module.ts

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,31 @@
11
import { BrowserModule } from '@angular/platform-browser';
22
import { NgModule } from '@angular/core';
3+
import { HttpClientModule } from '@angular/common/http';
34

5+
import { UsersService } from './services/users.service';
46

57
import { AppComponent } from './app.component';
68
import { HeaderComponent } from './components/header/header.component';
79
import { UsersComponent } from './components/users/users.component';
810
import { UserCardComponent } from './components/user-card/user-card.component';
11+
import { AppRoutingModule } from './/app-routing.module';
12+
import { AboutComponent } from './components/pages/about/about.component';
913

1014

1115
@NgModule({
1216
declarations: [
1317
AppComponent,
1418
HeaderComponent,
1519
UsersComponent,
16-
UserCardComponent
20+
UserCardComponent,
21+
AboutComponent
1722
],
1823
imports: [
19-
BrowserModule
24+
BrowserModule,
25+
HttpClientModule,
26+
AppRoutingModule
2027
],
21-
providers: [],
28+
providers: [UsersService],
2229
bootstrap: [AppComponent]
2330
})
2431
export class AppModule { }

src/app/mock-users.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
export const USERS = [
1+
import { User } from './models/user';
2+
3+
export const USERS: User[] = [
24
{
35
"guid": "60e58cc8-8a43-4d07-bba1-5a4c0e32a8ee",
46
"isActive": true,

src/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<head>
55
<meta charset="utf-8">
6-
<title>Blog</title>
6+
<title>Contact Application</title>
77
<base href="/">
88

99
<meta name="viewport" content="width=device-width, initial-scale=1">

0 commit comments

Comments
 (0)