Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- Ionic modal
- 앵귤러 애니메이션
- Angular Router
- TAILWIND
- 아이오닉 스크롤 이벤트
- ApexChart
- formgroup
- 호버
- 앵귤러 모달
- route
- 검색
- mysql if
- 스크롤 이벤트
- 모달
- angular route
- prisma
- angular button
- angular modal
- summary
- modal
- Oracle LISTAGG 사용 예시
- Router
- angular animation
- flex-1
- scroll
- 옵저버블
- 셀렉트박스 커스텀
- ajax 사용 예시
- 스크롤 이벤트 감지
- egov spring ajax 사용 예시
Archives
- Today
- Total
깜놀하는 해므찌로
Angular Router 앵귤러 라우터 작성 방법 본문
반응형
SMALL
import { Routes } from '@angular/router';
import { DashboardPage } from './pages/dashboard/dashboard.page';
import { BranchPage } from './pages/branch/branch.page';
import { EmployeePage } from './pages/employee/employee.page';
import { OrderPage } from './pages/order/order.page';
import { FaqPage } from './pages/faq/faq/faq.page';
import { OneOnonePage } from './pages/oneOnone/one-onone/one-onone.page';
import { MenuPage } from './pages/menu/menu/menu.page';
import { CreatePage } from './pages/menu/menu/create/create.page';
import { OptionPage } from './pages/menu/menu/option/option.page';
import { NoticePage } from './pages/notice/notice/notice.page';
import { StatisticsPage } from './pages/statistics/statistics/statistics.page';
import { AdminPage } from './pages/admin/admin/admin.page';
import { InventoryPage } from './pages/inventory/inventory/inventory.page';
import { RequestPage } from './pages/inventory/inventory/request/request.page';
export const routes: Routes = [
{
path: 'dashboard',
children:[
{path: '', component: DashboardPage},
]
},
{
path: 'order',
children: [
{path: '', component: OrderPage},
]
},
{
path: 'oneOnone',
children: [
{path: '', component: OneOnonePage},
]
},
{
path: '',
children: [
{path: 'inventory', component: InventoryPage},
{path: 'request', component: RequestPage},
],
},
{
path: 'branch',
children: [
{path: '', component: BranchPage},
]
},
{
path: 'employee',
children: [
{path: '', component: EmployeePage},
]
},
{
path: '',
children: [
{path: 'menu', children: [
{path: '', component: MenuPage},
{path: 'create', component: CreatePage},
{path: 'option', component: OptionPage},
]},
]
},
{
path: '',
children: [
{path: 'faq', component: FaqPage},
]
},
{
path: '',
children: [
{path: 'notice', component: NoticePage},
]
},
{
path: '',
children: [
{path: 'statistics', component: StatisticsPage},
]
},
{
path: '',
children: [
{path: 'admin', children: [
{path: '', component: AdminPage},
{path: 'form', loadComponent: () => import('./components/modal-content/modal-content.component').then(m => m.ModalContentComponent)}
]},
]
},
];
1. 자식요소가 있는 경우 부모 요소는 메뉴를 펼치기만 하도록 하기
2. 자식요소가 있는 경우 부모 요소에서는 path 를 넣지 않고 자식에서 path, component 설정하기
3. 이벤트 동작 시 열어야 할 페이지만 그때 그때 import 하도록 하기
반응형
LIST
'IT' 카테고리의 다른 글
LocalStorage 활용 예시 / Angular (0) | 2023.04.14 |
---|---|
Ionic radio 활용 예시 *ngFor (0) | 2023.04.14 |
Angular pagination custom 앵귤러 페이지네이션 커스텀 예시 (0) | 2023.04.13 |
Angular {{}} 문자열 바인딩, 이중 중괄호 표현식 (0) | 2023.04.13 |
Angular ... 인자 (0) | 2023.04.13 |