Skip to content

Commit 1914618

Browse files
committed
feat: initial implementation of movie module
1 parent 7bf2287 commit 1914618

13 files changed

+80
-41
lines changed

src/app/app.module.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import { BrowserModule } from '@angular/platform-browser';
21
import { NgModule } from '@angular/core';
2+
import { BrowserModule } from '@angular/platform-browser';
3+
import { RouterModule } from '@angular/router';
34

45
import { AppComponent } from './app.component';
5-
import { HomeModule } from './home/home.module';
6-
import { RouterModule } from '@angular/router';
76
import { AppRoutes } from './app.routes';
7+
import { MovieModule } from './movie/movie.module';
88

99
@NgModule({
1010
declarations: [
1111
AppComponent
1212
],
1313
imports: [
1414
BrowserModule,
15-
HomeModule,
15+
MovieModule,
1616
RouterModule.forRoot(AppRoutes)
1717
],
1818
providers: [],

src/app/app.routes.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Routes } from '@angular/router';
2-
import { HomeComponent } from './home/home.component';
32

43
export const AppRoutes: Routes = [
5-
{ path: '', component: HomeComponent }
4+
{ path: '', redirectTo: 'movie', pathMatch: 'full' }
65
];

src/app/home/home.component.html

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/app/home/home.component.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/app/home/home.module.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<p>
2+
movie-list works!
3+
</p>

src/app/home/home.component.spec.ts renamed to src/app/movie/movie-list/movie-list.component.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
22

3-
import { HomeComponent } from './home.component';
3+
import { MovieListComponent } from './movie-list.component';
44

5-
describe('HomeComponent', () => {
6-
let component: HomeComponent;
7-
let fixture: ComponentFixture<HomeComponent>;
5+
describe('MovieListComponent', () => {
6+
let component: MovieListComponent;
7+
let fixture: ComponentFixture<MovieListComponent>;
88

99
beforeEach(async(() => {
1010
TestBed.configureTestingModule({
11-
declarations: [ HomeComponent ]
11+
declarations: [ MovieListComponent ]
1212
})
1313
.compileComponents();
1414
}));
1515

1616
beforeEach(() => {
17-
fixture = TestBed.createComponent(HomeComponent);
17+
fixture = TestBed.createComponent(MovieListComponent);
1818
component = fixture.componentInstance;
1919
fixture.detectChanges();
2020
});
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Component, OnInit } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-movie-list',
5+
templateUrl: './movie-list.component.html',
6+
styleUrls: ['./movie-list.component.scss']
7+
})
8+
export class MovieListComponent implements OnInit {
9+
10+
constructor() { }
11+
12+
ngOnInit() {
13+
}
14+
15+
}

src/app/movie/movie.module.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { NgModule } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
3+
import { MovieService } from './movie.service';
4+
import { MovieListComponent } from './movie-list/movie-list.component';
5+
import { RouterModule } from '@angular/router';
6+
import { MovieRoutes } from './movie.routes';
7+
8+
@NgModule({
9+
imports: [
10+
CommonModule,
11+
RouterModule.forChild(MovieRoutes)
12+
],
13+
declarations: [
14+
MovieListComponent
15+
],
16+
providers: [
17+
MovieService
18+
]
19+
})
20+
export class MovieModule { }

0 commit comments

Comments
 (0)