22 changed files with 64 additions and 61 deletions
@ -1,8 +1,13 @@ |
|||
import { NgModule } from '@angular/core'; |
|||
import { RouterModule, Routes } from '@angular/router'; |
|||
import { CatalogComponent } from './catalog.component'; |
|||
|
|||
const routes: Routes = [{ path: '', component: CatalogComponent }]; |
|||
const routes: Routes = [ |
|||
{ path: '', redirectTo: 'products', pathMatch: 'full' }, |
|||
{ |
|||
path: 'products', |
|||
loadChildren: () => import('./pages/product/product.module').then(m => m.ProductModule), |
|||
}, |
|||
]; |
|||
|
|||
@NgModule({ |
|||
imports: [RouterModule.forChild(routes)], |
|||
@ -1,10 +1,7 @@ |
|||
import { NgModule } from '@angular/core'; |
|||
import { CatalogRoutingModule } from './catalog-routing.module'; |
|||
import { CatalogComponent } from './catalog.component'; |
|||
|
|||
@NgModule({ |
|||
declarations: [CatalogComponent], |
|||
imports: [CatalogRoutingModule], |
|||
exports: [CatalogComponent], |
|||
}) |
|||
export class CatalogModule {} |
|||
@ -1,20 +0,0 @@ |
|||
import { Component, OnInit } from '@angular/core'; |
|||
|
|||
@Component({ |
|||
selector: 'lib-catalog', |
|||
template: ` |
|||
<p> |
|||
catalog works! |
|||
</p> |
|||
`,
|
|||
styles: [ |
|||
] |
|||
}) |
|||
export class CatalogComponent implements OnInit { |
|||
|
|||
constructor() { } |
|||
|
|||
ngOnInit(): void { |
|||
} |
|||
|
|||
} |
|||
@ -1,16 +0,0 @@ |
|||
import { TestBed } from '@angular/core/testing'; |
|||
|
|||
import { CatalogService } from './catalog.service'; |
|||
|
|||
describe('CatalogService', () => { |
|||
let service: CatalogService; |
|||
|
|||
beforeEach(() => { |
|||
TestBed.configureTestingModule({}); |
|||
service = TestBed.inject(CatalogService); |
|||
}); |
|||
|
|||
it('should be created', () => { |
|||
expect(service).toBeTruthy(); |
|||
}); |
|||
}); |
|||
@ -1,9 +0,0 @@ |
|||
import { Injectable } from '@angular/core'; |
|||
|
|||
@Injectable({ |
|||
providedIn: 'root' |
|||
}) |
|||
export class CatalogService { |
|||
|
|||
constructor() { } |
|||
} |
|||
@ -0,0 +1 @@ |
|||
export * from './product'; |
|||
@ -0,0 +1,3 @@ |
|||
export * from './product-routing.module'; |
|||
export * from './product.component'; |
|||
export * from './product.module'; |
|||
@ -0,0 +1,11 @@ |
|||
import { NgModule } from '@angular/core'; |
|||
import { RouterModule, Routes } from '@angular/router'; |
|||
import { ProductComponent } from './product.component'; |
|||
|
|||
const routes: Routes = [{ path: '', component: ProductComponent }]; |
|||
|
|||
@NgModule({ |
|||
imports: [RouterModule.forChild(routes)], |
|||
exports: [RouterModule] |
|||
}) |
|||
export class ProductRoutingModule { } |
|||
@ -0,0 +1 @@ |
|||
<p>product works!</p> |
|||
@ -1,20 +1,20 @@ |
|||
import { ComponentFixture, TestBed } from '@angular/core/testing'; |
|||
|
|||
import { CatalogComponent } from './catalog.component'; |
|||
import { ProductComponent } from './product.component'; |
|||
|
|||
describe('CatalogComponent', () => { |
|||
let component: CatalogComponent; |
|||
let fixture: ComponentFixture<CatalogComponent>; |
|||
describe('ProductComponent', () => { |
|||
let component: ProductComponent; |
|||
let fixture: ComponentFixture<ProductComponent>; |
|||
|
|||
beforeEach(async () => { |
|||
await TestBed.configureTestingModule({ |
|||
declarations: [ CatalogComponent ] |
|||
declarations: [ ProductComponent ] |
|||
}) |
|||
.compileComponents(); |
|||
}); |
|||
|
|||
beforeEach(() => { |
|||
fixture = TestBed.createComponent(CatalogComponent); |
|||
fixture = TestBed.createComponent(ProductComponent); |
|||
component = fixture.componentInstance; |
|||
fixture.detectChanges(); |
|||
}); |
|||
@ -0,0 +1,15 @@ |
|||
import { Component, OnInit } from '@angular/core'; |
|||
|
|||
@Component({ |
|||
selector: 'lib-product', |
|||
templateUrl: './product.component.html', |
|||
styleUrls: ['./product.component.css'] |
|||
}) |
|||
export class ProductComponent implements OnInit { |
|||
|
|||
constructor() { } |
|||
|
|||
ngOnInit(): void { |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
import { NgModule } from '@angular/core'; |
|||
import { CommonModule } from '@angular/common'; |
|||
|
|||
import { ProductRoutingModule } from './product-routing.module'; |
|||
import { ProductComponent } from './product.component'; |
|||
|
|||
|
|||
@NgModule({ |
|||
declarations: [ |
|||
ProductComponent |
|||
], |
|||
imports: [ |
|||
CommonModule, |
|||
ProductRoutingModule |
|||
] |
|||
}) |
|||
export class ProductModule { } |
|||
@ -1,7 +1,5 @@ |
|||
/* |
|||
* Public API Surface of catalog |
|||
*/ |
|||
|
|||
export * from './lib/catalog.service'; |
|||
export * from './lib/catalog.component'; |
|||
export * from './lib/catalog.module'; |
|||
export * from './catalog.module'; |
|||
export * from './pages'; |
|||
|
|||
Loading…
Reference in new issue