浏览代码

Renamed details component to course details in course folder

master
kj1352 5 年前
父节点
当前提交
a3e6b37a1b
共有 6 个文件被更改,包括 17 次插入18 次删除
  1. +2
    -3
      src/app/app-routing.module.ts
  2. +2
    -2
      src/app/app.module.ts
  3. +0
    -0
      src/app/tabs/courses/course-details/course-details.component.html
  4. +0
    -0
      src/app/tabs/courses/course-details/course-details.component.scss
  5. +6
    -6
      src/app/tabs/courses/course-details/course-details.component.spec.ts
  6. +7
    -7
      src/app/tabs/courses/course-details/course-details.component.ts

+ 2
- 3
src/app/app-routing.module.ts 查看文件

@@ -2,7 +2,7 @@ import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router'; import { Routes, RouterModule } from '@angular/router';
import { WelcomeComponent } from './welcome/welcome.component'; import { WelcomeComponent } from './welcome/welcome.component';
import { TabsComponent } from './tabs/tabs.component'; import { TabsComponent } from './tabs/tabs.component';
import { DetailsComponent } from './tabs/courses/details/details.component';
import { CourseDetailsComponent } from './tabs/courses/course-details/course-details.component';
import { VideoChapterComponent } from './tabs/courses/video-chapter/video-chapter.component'; import { VideoChapterComponent } from './tabs/courses/video-chapter/video-chapter.component';
import { VideoNotesComponent } from './tabs/courses/video-chapter/video-notes/video-notes.component'; import { VideoNotesComponent } from './tabs/courses/video-chapter/video-notes/video-notes.component';
import { CalendarComponent } from './calendar/calendar.component'; import { CalendarComponent } from './calendar/calendar.component';
@@ -15,8 +15,7 @@ const routes: Routes = [
{ component: WelcomeComponent, path: 'welcome' }, { component: WelcomeComponent, path: 'welcome' },
{ component: TabsComponent, path: 'tabs' }, { component: TabsComponent, path: 'tabs' },
{ component: TabsComponent, path: 'tabs/:subpage' }, { component: TabsComponent, path: 'tabs/:subpage' },
{ component: DetailsComponent, path: 'course-details' },
{ component: DetailsComponent, path: 'course-details/:heading' },
{ component: CourseDetailsComponent, path: 'course-details/:heading' },
{ component: ChapterNotesComponent, path: 'chapter-notes/:heading' }, { component: ChapterNotesComponent, path: 'chapter-notes/:heading' },
{ component: VideoChapterComponent, path: 'video-chapter/:heading' }, { component: VideoChapterComponent, path: 'video-chapter/:heading' },
{ component: VideoNotesComponent, path: 'video-notes/:heading' }, { component: VideoNotesComponent, path: 'video-notes/:heading' },


+ 2
- 2
src/app/app.module.ts 查看文件

@@ -13,7 +13,6 @@ import { HomeComponent } from './tabs/home/home.component';
import { CoursesComponent } from './tabs/courses/courses.component'; import { CoursesComponent } from './tabs/courses/courses.component';
import { ReportsComponent } from './tabs/reports/reports.component'; import { ReportsComponent } from './tabs/reports/reports.component';
import { MoreComponent } from './tabs/more/more.component'; import { MoreComponent } from './tabs/more/more.component';
import { DetailsComponent } from './tabs/courses/details/details.component';
import { VideoChapterComponent } from './tabs/courses/video-chapter/video-chapter.component'; import { VideoChapterComponent } from './tabs/courses/video-chapter/video-chapter.component';
import { ServiceWorkerModule } from '@angular/service-worker'; import { ServiceWorkerModule } from '@angular/service-worker';
import { environment } from '../environments/environment'; import { environment } from '../environments/environment';
@@ -24,6 +23,7 @@ import { ForumPageComponent } from './tabs/more/forum-page/forum-page.component'
import { ConfirmationPopupComponent } from './reusable-components/confirmation-popup/confirmation-popup.component'; import { ConfirmationPopupComponent } from './reusable-components/confirmation-popup/confirmation-popup.component';
import { VideoNotesComponent } from './tabs/courses/video-chapter/video-notes/video-notes.component'; import { VideoNotesComponent } from './tabs/courses/video-chapter/video-notes/video-notes.component';
import { ChapterNotesComponent } from './tabs/courses/chapter-notes/chapter-notes.component'; import { ChapterNotesComponent } from './tabs/courses/chapter-notes/chapter-notes.component';
import { CourseDetailsComponent } from './tabs/courses/course-details/course-details.component';


@NgModule({ @NgModule({
declarations: [ declarations: [
@@ -34,7 +34,6 @@ import { ChapterNotesComponent } from './tabs/courses/chapter-notes/chapter-note
CoursesComponent, CoursesComponent,
ReportsComponent, ReportsComponent,
MoreComponent, MoreComponent,
DetailsComponent,
VideoChapterComponent, VideoChapterComponent,
CalendarComponent, CalendarComponent,
AttendanceComponent, AttendanceComponent,
@@ -43,6 +42,7 @@ import { ChapterNotesComponent } from './tabs/courses/chapter-notes/chapter-note
ConfirmationPopupComponent, ConfirmationPopupComponent,
VideoNotesComponent, VideoNotesComponent,
ChapterNotesComponent, ChapterNotesComponent,
CourseDetailsComponent,
], ],
imports: [ imports: [
BrowserModule, BrowserModule,


src/app/tabs/courses/details/details.component.html → src/app/tabs/courses/course-details/course-details.component.html 查看文件


src/app/tabs/courses/details/details.component.scss → src/app/tabs/courses/course-details/course-details.component.scss 查看文件


src/app/tabs/courses/details/details.component.spec.ts → src/app/tabs/courses/course-details/course-details.component.spec.ts 查看文件

@@ -1,20 +1,20 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { async, ComponentFixture, TestBed } from '@angular/core/testing';


import { DetailsComponent } from './details.component';
import { CourseDetailsComponent } from './course-details.component';


describe('DetailsComponent', () => {
let component: DetailsComponent;
let fixture: ComponentFixture<DetailsComponent>;
describe('CourseDetailsComponent', () => {
let component: CourseDetailsComponent;
let fixture: ComponentFixture<CourseDetailsComponent>;


beforeEach(async(() => { beforeEach(async(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
declarations: [ DetailsComponent ]
declarations: [ CourseDetailsComponent ]
}) })
.compileComponents(); .compileComponents();
})); }));


beforeEach(() => { beforeEach(() => {
fixture = TestBed.createComponent(DetailsComponent);
fixture = TestBed.createComponent(CourseDetailsComponent);
component = fixture.componentInstance; component = fixture.componentInstance;
fixture.detectChanges(); fixture.detectChanges();
}); });

src/app/tabs/courses/details/details.component.ts → src/app/tabs/courses/course-details/course-details.component.ts 查看文件

@@ -4,11 +4,11 @@ import { Subscription } from 'rxjs';
import { Location } from '@angular/common'; import { Location } from '@angular/common';


@Component({ @Component({
selector: 'app-details',
templateUrl: './details.component.html',
styleUrls: ['./details.component.scss']
selector: 'app-course-details',
templateUrl: './course-details.component.html',
styleUrls: ['./course-details.component.scss']
}) })
export class DetailsComponent implements OnInit {
export class CourseDetailsComponent implements OnInit {
selectedSegment: string = 'home'; selectedSegment: string = 'home';
heading: string; heading: string;
routeSubscription: Subscription; routeSubscription: Subscription;
@@ -16,16 +16,16 @@ export class DetailsComponent implements OnInit {
showDeletePopup: boolean = false; showDeletePopup: boolean = false;
isSubSegment: boolean = true; isSubSegment: boolean = true;


constructor(
constructor(
private route: ActivatedRoute, private route: ActivatedRoute,
private location: Location private location: Location
) { } ) { }


ngOnInit(): void {
ngOnInit(): void {
this.routeSubscription = this.route.params.subscribe((params) => { this.routeSubscription = this.route.params.subscribe((params) => {
this.heading = params['heading']; this.heading = params['heading'];
}); });
}
}


ngOnDestroy() { ngOnDestroy() {
this.routeSubscription.unsubscribe(); this.routeSubscription.unsubscribe();