Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
topic1group3
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Natthaphong Malaphan
topic1group3
Commits
4c0e0ec4
Commit
4c0e0ec4
authored
Sep 23, 2020
by
Athip Sirisawetkunwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add component page
parent
e9c8fbd9
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
117 additions
and
12 deletions
+117
-12
angular.json
mean/angular.json
+4
-0
app-routing.module.ts
mean/src/app/app-routing.module.ts
+25
-10
app.module.ts
mean/src/app/app.module.ts
+3
-1
create-topic.component.css
mean/src/app/create-topic/create-topic.component.css
+0
-0
create-topic.component.html
mean/src/app/create-topic/create-topic.component.html
+1
-0
create-topic.component.spec.ts
mean/src/app/create-topic/create-topic.component.spec.ts
+25
-0
create-topic.component.ts
mean/src/app/create-topic/create-topic.component.ts
+15
-0
header.component.html
mean/src/app/header/header.component.html
+2
-0
home.component.html
mean/src/app/home/home.component.html
+1
-1
topic.component.css
mean/src/app/topic/topic.component.css
+0
-0
topic.component.html
mean/src/app/topic/topic.component.html
+1
-0
topic.component.spec.ts
mean/src/app/topic/topic.component.spec.ts
+25
-0
topic.component.ts
mean/src/app/topic/topic.component.ts
+15
-0
No files found.
mean/angular.json
View file @
4c0e0ec4
...
...
@@ -103,5 +103,8 @@
"@schematics/angular:directive"
:
{
"prefix"
:
"app"
}
},
"cli"
:
{
"analytics"
:
"9ab085ba-bb22-4e92-92f7-a6b2e0ff105f"
}
}
\ No newline at end of file
mean/src/app/app-routing.module.ts
View file @
4c0e0ec4
import
{
NgModule
}
from
'@angular/core'
;
import
{
RouterModule
,
Routes
}
from
'@angular/router'
;
import
{
AuthGuard
}
from
'./shared/guards'
;
import
{
HomeComponent
}
from
'./home/home.component'
;
import
{
NgModule
}
from
"@angular/core"
;
import
{
RouterModule
,
Routes
}
from
"@angular/router"
;
import
{
AuthGuard
}
from
"./shared/guards"
;
import
{
HomeComponent
}
from
"./home/home.component"
;
import
{
TopicComponent
}
from
"./topic/topic.component"
;
import
{
CreateTopicComponent
}
from
"./create-topic/create-topic.component"
;
const
routes
:
Routes
=
[
{
path
:
''
,
path
:
""
,
component
:
HomeComponent
,
canActivate
:
[
AuthGuard
],
},
{
path
:
'auth'
,
loadChildren
:
()
=>
import
(
'./auth/auth.module'
).
then
(
m
=>
m
.
AuthModule
),
path
:
"/topic"
,
component
:
TopicComponent
},
{
path
:
"/create"
,
component
:
CreateTopicComponent
},
,
{
path
:
"second-component"
,
component
:
SecondComponent
},
{
path
:
"auth"
,
loadChildren
:
()
=>
import
(
"./auth/auth.module"
).
then
((
m
)
=>
m
.
AuthModule
),
},
{
path
:
'admin'
,
loadChildren
:
()
=>
import
(
'./admin/admin.module'
).
then
(
m
=>
m
.
AdminModule
),
path
:
"admin"
,
loadChildren
:
()
=>
import
(
"./admin/admin.module"
).
then
((
m
)
=>
m
.
AdminModule
),
},
];
...
...
mean/src/app/app.module.ts
View file @
4c0e0ec4
...
...
@@ -12,6 +12,8 @@ import { AppRoutingModule } from './app-routing.module';
import
{
HeaderComponent
}
from
'./header/header.component'
;
import
{
HomeComponent
}
from
'./home/home.component'
;
import
{
AuthService
}
from
'./shared/services'
;
import
{
TopicComponent
}
from
'./topic/topic.component'
;
import
{
CreateTopicComponent
}
from
'./create-topic/create-topic.component'
;
export
function
appInitializerFactory
(
authService
:
AuthService
)
{
return
()
=>
authService
.
checkTheUserOnTheFirstLoad
();
...
...
@@ -19,7 +21,7 @@ export function appInitializerFactory(authService: AuthService) {
@
NgModule
({
imports
:
[
BrowserAnimationsModule
,
HttpClientModule
,
SharedModule
,
AppRoutingModule
],
declarations
:
[
AppComponent
,
HeaderComponent
,
HomeComponent
],
declarations
:
[
AppComponent
,
HeaderComponent
,
HomeComponent
,
TopicComponent
,
CreateTopicComponent
],
providers
:
[
{
provide
:
HTTP_INTERCEPTORS
,
...
...
mean/src/app/create-topic/create-topic.component.css
0 → 100644
View file @
4c0e0ec4
mean/src/app/create-topic/create-topic.component.html
0 → 100644
View file @
4c0e0ec4
<p>
create-topic works!
</p>
mean/src/app/create-topic/create-topic.component.spec.ts
0 → 100644
View file @
4c0e0ec4
import
{
async
,
ComponentFixture
,
TestBed
}
from
'@angular/core/testing'
;
import
{
CreateTopicComponent
}
from
'./create-topic.component'
;
describe
(
'CreateTopicComponent'
,
()
=>
{
let
component
:
CreateTopicComponent
;
let
fixture
:
ComponentFixture
<
CreateTopicComponent
>
;
beforeEach
(
async
(()
=>
{
TestBed
.
configureTestingModule
({
declarations
:
[
CreateTopicComponent
]
})
.
compileComponents
();
}));
beforeEach
(()
=>
{
fixture
=
TestBed
.
createComponent
(
CreateTopicComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'should create'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
mean/src/app/create-topic/create-topic.component.ts
0 → 100644
View file @
4c0e0ec4
import
{
Component
,
OnInit
}
from
'@angular/core'
;
@
Component
({
selector
:
'app-create-topic'
,
templateUrl
:
'./create-topic.component.html'
,
styleUrls
:
[
'./create-topic.component.css'
]
})
export
class
CreateTopicComponent
implements
OnInit
{
constructor
()
{
}
ngOnInit
():
void
{
}
}
mean/src/app/header/header.component.html
View file @
4c0e0ec4
...
...
@@ -4,6 +4,8 @@
<span
class=
"example-spacer"
></span>
<a
class=
"links side"
routerLink=
"/auth/login"
*
ngIf=
"!user"
>
Login
</a>
<div>
<a
class=
"links side"
*
ngIf=
"user"
routerLink=
"/topic"
>
Topic
</a>
<a
class=
"links side"
*
ngIf=
"user"
routerLink=
"/create"
>
Create topic
</a>
<a
class=
"links side"
*
ngIf=
"user"
[
matMenuTriggerFor
]="
menu
"
>
<mat-icon>
account_circle
</mat-icon>
{{ user.fullname }}
</a>
...
...
mean/src/app/home/home.component.html
View file @
4c0e0ec4
<p>
home
works!
home
</p>
mean/src/app/topic/topic.component.css
0 → 100644
View file @
4c0e0ec4
mean/src/app/topic/topic.component.html
0 → 100644
View file @
4c0e0ec4
<p>
topic works!
</p>
mean/src/app/topic/topic.component.spec.ts
0 → 100644
View file @
4c0e0ec4
import
{
async
,
ComponentFixture
,
TestBed
}
from
'@angular/core/testing'
;
import
{
TopicComponent
}
from
'./topic.component'
;
describe
(
'TopicComponent'
,
()
=>
{
let
component
:
TopicComponent
;
let
fixture
:
ComponentFixture
<
TopicComponent
>
;
beforeEach
(
async
(()
=>
{
TestBed
.
configureTestingModule
({
declarations
:
[
TopicComponent
]
})
.
compileComponents
();
}));
beforeEach
(()
=>
{
fixture
=
TestBed
.
createComponent
(
TopicComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'should create'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
mean/src/app/topic/topic.component.ts
0 → 100644
View file @
4c0e0ec4
import
{
Component
,
OnInit
}
from
'@angular/core'
;
@
Component
({
selector
:
'app-topic'
,
templateUrl
:
'./topic.component.html'
,
styleUrls
:
[
'./topic.component.css'
]
})
export
class
TopicComponent
implements
OnInit
{
constructor
()
{
}
ngOnInit
():
void
{
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment