Add template for discussion picker

This commit is contained in:
Michał Romaszkin 2020-06-13 14:47:49 +02:00
parent 192c52f587
commit 88d544f10a
6 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1 @@
<p>discussion-chooser works!</p>

View File

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-discussion-chooser',
templateUrl: './discussion-chooser.component.html',
styleUrls: ['./discussion-chooser.component.scss']
})
export class DiscussionChooserComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

View File

@ -1,11 +1,23 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { Routes, RouterModule, Router } from '@angular/router'; import { Routes, RouterModule, Router } from '@angular/router';
import { MainViewComponent } from './main-view.component'; import { MainViewComponent } from './main-view.component';
import { DiscussionChooserComponent } from './discussion-chooser/discussion-chooser.component';
const routes: Routes = [ const routes: Routes = [
{ {
path: '', path: '',
component: MainViewComponent, component: MainViewComponent,
children: [
{
path: 'discussions',
component: DiscussionChooserComponent,
},
{
path: '',
redirectTo: 'discussions',
pathMatch: 'full',
},
],
}, },
]; ];

View File

@ -14,4 +14,7 @@
</div> </div>
</nb-layout-header> </nb-layout-header>
<nb-sidebar tag="main"></nb-sidebar> <nb-sidebar tag="main"></nb-sidebar>
<nb-layout-column>
<router-outlet></router-outlet>
</nb-layout-column>
</nb-layout> </nb-layout>

View File

@ -2,6 +2,7 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { MainViewComponent } from './main-view.component'; import { MainViewComponent } from './main-view.component';
import { DiscussionChooserComponent } from './discussion-chooser/discussion-chooser.component';
import { MainViewRoutingModule } from './main-view-routing.module'; import { MainViewRoutingModule } from './main-view-routing.module';
import { import {
@ -12,7 +13,7 @@ import {
} from '@nebular/theme'; } from '@nebular/theme';
@NgModule({ @NgModule({
declarations: [MainViewComponent], declarations: [MainViewComponent, DiscussionChooserComponent],
imports: [ imports: [
CommonModule, CommonModule,
MainViewRoutingModule, MainViewRoutingModule,