setup usersa
This commit is contained in:
		| @@ -0,0 +1,16 @@ | ||||
| import { NgModule } from '@angular/core'; | ||||
| import { RouterModule, Routes } from '@angular/router'; | ||||
| import { AllowancePage } from './allowance.page'; | ||||
|  | ||||
| const routes: Routes = [ | ||||
|   { | ||||
|     path: '', | ||||
|     component: AllowancePage, | ||||
|   } | ||||
| ]; | ||||
|  | ||||
| @NgModule({ | ||||
|   imports: [RouterModule.forChild(routes)], | ||||
|   exports: [RouterModule] | ||||
| }) | ||||
| export class AllowancePageRoutingModule {} | ||||
| @@ -0,0 +1,18 @@ | ||||
| import { IonicModule } from '@ionic/angular'; | ||||
| import { NgModule } from '@angular/core'; | ||||
| import { CommonModule } from '@angular/common'; | ||||
| import { FormsModule } from '@angular/forms'; | ||||
| import { AllowancePage } from './allowance.page'; | ||||
|  | ||||
| import { AllowancePageRoutingModule } from './allowance-routing.module'; | ||||
|  | ||||
| @NgModule({ | ||||
|   imports: [ | ||||
|     IonicModule, | ||||
|     CommonModule, | ||||
|     FormsModule, | ||||
|     AllowancePageRoutingModule | ||||
|   ], | ||||
|   declarations: [AllowancePage] | ||||
| }) | ||||
| export class AllowancePageModule {} | ||||
| @@ -0,0 +1,10 @@ | ||||
| <ion-header [translucent]="true"> | ||||
|   <ion-toolbar> | ||||
|     <ion-title> | ||||
|       Allowance | ||||
|     </ion-title> | ||||
|   </ion-toolbar> | ||||
| </ion-header> | ||||
|  | ||||
| <ion-content> | ||||
| </ion-content> | ||||
| @@ -0,0 +1,26 @@ | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||||
| import { IonicModule } from '@ionic/angular'; | ||||
|  | ||||
| import { ExploreContainerComponentModule } from '../explore-container/explore-container.module'; | ||||
|  | ||||
| import { AllowancePage } from './allowance.page'; | ||||
|  | ||||
| describe('AllowancePage', () => { | ||||
|   let component: AllowancePage; | ||||
|   let fixture: ComponentFixture<AllowancePage>; | ||||
|  | ||||
|   beforeEach(async () => { | ||||
|     await TestBed.configureTestingModule({ | ||||
|       declarations: [AllowancePage], | ||||
|       imports: [IonicModule.forRoot(), ExploreContainerComponentModule] | ||||
|     }).compileComponents(); | ||||
|  | ||||
|     fixture = TestBed.createComponent(AllowancePage); | ||||
|     component = fixture.componentInstance; | ||||
|     fixture.detectChanges(); | ||||
|   }); | ||||
|  | ||||
|   it('should create', () => { | ||||
|     expect(component).toBeTruthy(); | ||||
|   }); | ||||
| }); | ||||
| @@ -0,0 +1,14 @@ | ||||
| import { Component } from '@angular/core'; | ||||
| import { UserService } from 'src/app/services/user.service'; | ||||
|  | ||||
| @Component({ | ||||
|   selector: 'app-allowance', | ||||
|   templateUrl: 'allowance.page.html', | ||||
|   styleUrls: ['allowance.page.scss'], | ||||
|   standalone: false, | ||||
| }) | ||||
| export class AllowancePage { | ||||
|  | ||||
|   constructor(private userService: UserService) {} | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,16 @@ | ||||
| import { NgModule } from '@angular/core'; | ||||
| import { RouterModule, Routes } from '@angular/router'; | ||||
| import { HistoryPage } from './history.page'; | ||||
|  | ||||
| const routes: Routes = [ | ||||
|   { | ||||
|     path: '', | ||||
|     component: HistoryPage, | ||||
|   } | ||||
| ]; | ||||
|  | ||||
| @NgModule({ | ||||
|   imports: [RouterModule.forChild(routes)], | ||||
|   exports: [RouterModule] | ||||
| }) | ||||
| export class HistoryPageRoutingModule {} | ||||
| @@ -0,0 +1,18 @@ | ||||
| import { IonicModule } from '@ionic/angular'; | ||||
| import { NgModule } from '@angular/core'; | ||||
| import { CommonModule } from '@angular/common'; | ||||
| import { FormsModule } from '@angular/forms'; | ||||
| import { HistoryPage } from './history.page'; | ||||
|  | ||||
| import { HistoryPageRoutingModule } from './history-routing.module'; | ||||
|  | ||||
| @NgModule({ | ||||
|   imports: [ | ||||
|     IonicModule, | ||||
|     CommonModule, | ||||
|     FormsModule, | ||||
|     HistoryPageRoutingModule | ||||
|   ], | ||||
|   declarations: [HistoryPage] | ||||
| }) | ||||
| export class HistoryPageModule {} | ||||
| @@ -0,0 +1,11 @@ | ||||
| <ion-header [translucent]="true"> | ||||
|   <ion-toolbar> | ||||
|     <ion-title> | ||||
|       History | ||||
|     </ion-title> | ||||
|   </ion-toolbar> | ||||
| </ion-header> | ||||
|  | ||||
| <ion-content> | ||||
|  | ||||
| </ion-content> | ||||
| @@ -0,0 +1,26 @@ | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||||
| import { IonicModule } from '@ionic/angular'; | ||||
|  | ||||
| import { ExploreContainerComponentModule } from '../explore-container/explore-container.module'; | ||||
|  | ||||
| import { HistoryPage } from './history.page'; | ||||
|  | ||||
| describe('HistoryPage', () => { | ||||
|   let component: HistoryPage; | ||||
|   let fixture: ComponentFixture<HistoryPage>; | ||||
|  | ||||
|   beforeEach(async () => { | ||||
|     await TestBed.configureTestingModule({ | ||||
|       declarations: [HistoryPage], | ||||
|       imports: [IonicModule.forRoot(), ExploreContainerComponentModule] | ||||
|     }).compileComponents(); | ||||
|  | ||||
|     fixture = TestBed.createComponent(HistoryPage); | ||||
|     component = fixture.componentInstance; | ||||
|     fixture.detectChanges(); | ||||
|   }); | ||||
|  | ||||
|   it('should create', () => { | ||||
|     expect(component).toBeTruthy(); | ||||
|   }); | ||||
| }); | ||||
| @@ -0,0 +1,13 @@ | ||||
| import { Component } from '@angular/core'; | ||||
|  | ||||
| @Component({ | ||||
|   selector: 'app-history', | ||||
|   templateUrl: 'history.page.html', | ||||
|   styleUrls: ['history.page.scss'], | ||||
|   standalone: false, | ||||
| }) | ||||
| export class HistoryPage { | ||||
|  | ||||
|   constructor() {} | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,39 @@ | ||||
| import { NgModule } from '@angular/core'; | ||||
| import { RouterModule, Routes } from '@angular/router'; | ||||
| import { TabsPage } from './tabs.page'; | ||||
|  | ||||
| const routes: Routes = [ | ||||
|   { | ||||
|     path: 'tabs', | ||||
|     component: TabsPage, | ||||
|     children: [ | ||||
|       { | ||||
|         path: 'history', | ||||
|         loadChildren: () => import('../history/history.module').then(m => m.HistoryPageModule) | ||||
|       }, | ||||
|       { | ||||
|         path: 'allowance', | ||||
|         loadChildren: () => import('../allowance/allowance.module').then(m => m.AllowancePageModule) | ||||
|       }, | ||||
|       { | ||||
|         path: 'tasks', | ||||
|         loadChildren: () => import('../tasks/tasks.module').then(m => m.TasksPageModule) | ||||
|       }, | ||||
|       { | ||||
|         path: '', | ||||
|         redirectTo: '/tabs/allowance', | ||||
|         pathMatch: 'full' | ||||
|       } | ||||
|     ] | ||||
|   }, | ||||
|   { | ||||
|     path: '', | ||||
|     redirectTo: '/tabs/allowance', | ||||
|     pathMatch: 'full' | ||||
|   } | ||||
| ]; | ||||
|  | ||||
| @NgModule({ | ||||
|   imports: [RouterModule.forChild(routes),], | ||||
| }) | ||||
| export class TabsPageRoutingModule {} | ||||
| @@ -0,0 +1,27 @@ | ||||
| import { IonicModule } from '@ionic/angular'; | ||||
| import { NgModule } from '@angular/core'; | ||||
| import { CommonModule } from '@angular/common'; | ||||
| import { FormsModule } from '@angular/forms'; | ||||
| import {MatIconModule} from '@angular/material/icon'; | ||||
|  | ||||
| import { TabsPageRoutingModule } from './tabs-routing.module'; | ||||
|  | ||||
| import { TabsPage } from './tabs.page'; | ||||
| import { provideHttpClient } from '@angular/common/http'; | ||||
| import { UserService } from 'src/app/services/user.service'; | ||||
|  | ||||
| @NgModule({ | ||||
|   imports: [ | ||||
|     IonicModule, | ||||
|     CommonModule, | ||||
|     FormsModule, | ||||
|     TabsPageRoutingModule, | ||||
|     MatIconModule, | ||||
|   ], | ||||
|   declarations: [TabsPage], | ||||
|   providers: [ | ||||
|     provideHttpClient(), | ||||
|     UserService | ||||
|   ] | ||||
| }) | ||||
| export class TabsPageModule {} | ||||
| @@ -0,0 +1,13 @@ | ||||
| <ion-tabs> | ||||
|   <ion-tab-bar slot="bottom"> | ||||
|     <ion-tab-button tab="history" href="/tabs/history"> | ||||
|       <mat-icon>history</mat-icon> | ||||
|     </ion-tab-button> | ||||
|     <ion-tab-button tab="allowance" href="/tabs/allowance"> | ||||
|       <mat-icon>savings</mat-icon> | ||||
|     </ion-tab-button> | ||||
|     <ion-tab-button tab="tasks" href="/tabs/tasks"> | ||||
|       <mat-icon>task_alt</mat-icon> | ||||
|     </ion-tab-button> | ||||
|   </ion-tab-bar> | ||||
| </ion-tabs> | ||||
| @@ -0,0 +1,3 @@ | ||||
| .tab-selected { | ||||
|     background-color: var(--ion-color-secondary); | ||||
| } | ||||
| @@ -0,0 +1,26 @@ | ||||
| import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||||
|  | ||||
| import { TabsPage } from './tabs.page'; | ||||
|  | ||||
| describe('TabsPage', () => { | ||||
|   let component: TabsPage; | ||||
|   let fixture: ComponentFixture<TabsPage>; | ||||
|  | ||||
|   beforeEach(async () => { | ||||
|     await TestBed.configureTestingModule({ | ||||
|       declarations: [TabsPage], | ||||
|       schemas: [CUSTOM_ELEMENTS_SCHEMA], | ||||
|     }).compileComponents(); | ||||
|   }); | ||||
|  | ||||
|   beforeEach(() => { | ||||
|     fixture = TestBed.createComponent(TabsPage); | ||||
|     component = fixture.componentInstance; | ||||
|     fixture.detectChanges(); | ||||
|   }); | ||||
|  | ||||
|   it('should create', () => { | ||||
|     expect(component).toBeTruthy(); | ||||
|   }); | ||||
| }); | ||||
| @@ -0,0 +1,12 @@ | ||||
| import { Component } from '@angular/core'; | ||||
|  | ||||
| @Component({ | ||||
|   selector: 'app-tabs', | ||||
|   templateUrl: 'tabs.page.html', | ||||
|   styleUrls: ['tabs.page.scss'], | ||||
|   standalone: false, | ||||
| }) | ||||
| export class TabsPage { | ||||
|   constructor() {} | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,16 @@ | ||||
| import { NgModule } from '@angular/core'; | ||||
| import { RouterModule, Routes } from '@angular/router'; | ||||
| import { TasksPage } from './tasks.page'; | ||||
|  | ||||
| const routes: Routes = [ | ||||
|   { | ||||
|     path: '', | ||||
|     component: TasksPage, | ||||
|   } | ||||
| ]; | ||||
|  | ||||
| @NgModule({ | ||||
|   imports: [RouterModule.forChild(routes)], | ||||
|   exports: [RouterModule] | ||||
| }) | ||||
| export class TasksPageRoutingModule {} | ||||
| @@ -0,0 +1,18 @@ | ||||
| import { IonicModule } from '@ionic/angular'; | ||||
| import { NgModule } from '@angular/core'; | ||||
| import { CommonModule } from '@angular/common'; | ||||
| import { FormsModule } from '@angular/forms'; | ||||
| import { TasksPage } from './tasks.page'; | ||||
|  | ||||
| import { TasksPageRoutingModule } from './tasks-routing.module'; | ||||
|  | ||||
| @NgModule({ | ||||
|   imports: [ | ||||
|     IonicModule, | ||||
|     CommonModule, | ||||
|     FormsModule, | ||||
|     TasksPageRoutingModule | ||||
|   ], | ||||
|   declarations: [TasksPage] | ||||
| }) | ||||
| export class TasksPageModule {} | ||||
| @@ -0,0 +1,10 @@ | ||||
| <ion-header [translucent]="true"> | ||||
|   <ion-toolbar> | ||||
|     <ion-title> | ||||
|       Tasks | ||||
|     </ion-title> | ||||
|   </ion-toolbar> | ||||
| </ion-header> | ||||
|  | ||||
| <ion-content> | ||||
| </ion-content> | ||||
| @@ -0,0 +1,26 @@ | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||||
| import { IonicModule } from '@ionic/angular'; | ||||
|  | ||||
| import { ExploreContainerComponentModule } from '../explore-container/explore-container.module'; | ||||
|  | ||||
| import { TasksPage } from './tasks.page'; | ||||
|  | ||||
| describe('TasksPage', () => { | ||||
|   let component: TasksPage; | ||||
|   let fixture: ComponentFixture<TasksPage>; | ||||
|  | ||||
|   beforeEach(async () => { | ||||
|     await TestBed.configureTestingModule({ | ||||
|       declarations: [TasksPage], | ||||
|       imports: [IonicModule.forRoot(), ExploreContainerComponentModule] | ||||
|     }).compileComponents(); | ||||
|  | ||||
|     fixture = TestBed.createComponent(TasksPage); | ||||
|     component = fixture.componentInstance; | ||||
|     fixture.detectChanges(); | ||||
|   }); | ||||
|  | ||||
|   it('should create', () => { | ||||
|     expect(component).toBeTruthy(); | ||||
|   }); | ||||
| }); | ||||
| @@ -0,0 +1,13 @@ | ||||
| import { Component } from '@angular/core'; | ||||
|  | ||||
| @Component({ | ||||
|   selector: 'app-tasks', | ||||
|   templateUrl: 'tasks.page.html', | ||||
|   styleUrls: ['tasks.page.scss'], | ||||
|   standalone: false, | ||||
| }) | ||||
| export class TasksPage { | ||||
|  | ||||
|   constructor() {} | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,17 @@ | ||||
| import { NgModule } from '@angular/core'; | ||||
| import { Routes, RouterModule } from '@angular/router'; | ||||
|  | ||||
| import { UserLoginPage } from './user-login.page'; | ||||
|  | ||||
| const routes: Routes = [ | ||||
|   { | ||||
|     path: '', | ||||
|     component: UserLoginPage | ||||
|   } | ||||
| ]; | ||||
|  | ||||
| @NgModule({ | ||||
|   imports: [RouterModule.forChild(routes)], | ||||
|   exports: [RouterModule], | ||||
| }) | ||||
| export class UserLoginPageRoutingModule {} | ||||
| @@ -0,0 +1,26 @@ | ||||
| import { NgModule } from '@angular/core'; | ||||
| import { CommonModule } from '@angular/common'; | ||||
| import { FormsModule } from '@angular/forms'; | ||||
|  | ||||
| import { IonicModule } from '@ionic/angular'; | ||||
|  | ||||
| import { UserLoginPageRoutingModule } from './user-login-routing.module'; | ||||
|  | ||||
| import { UserLoginPage } from './user-login.page'; | ||||
| import { provideHttpClient } from '@angular/common/http'; | ||||
| import { UserService } from 'src/app/services/user.service'; | ||||
|  | ||||
| @NgModule({ | ||||
|   imports: [ | ||||
|     CommonModule, | ||||
|     FormsModule, | ||||
|     IonicModule, | ||||
|     UserLoginPageRoutingModule, | ||||
|   ], | ||||
|   declarations: [UserLoginPage], | ||||
|   providers: [ | ||||
|     provideHttpClient(), | ||||
|     UserService | ||||
|   ] | ||||
| }) | ||||
| export class UserLoginPageModule {} | ||||
| @@ -0,0 +1,6 @@ | ||||
| <ion-content> | ||||
|   <div class="title">Who are you?</div> | ||||
|   <div class="selection"> | ||||
|      | ||||
|   </div> | ||||
| </ion-content> | ||||
| @@ -0,0 +1,11 @@ | ||||
| .title, | ||||
| .selection { | ||||
|     display: flex; | ||||
|     justify-content: center; | ||||
| } | ||||
|  | ||||
| .title { | ||||
|     margin-top: 40%; | ||||
|     color: var(--ion-color-primary); | ||||
|     font-size: 40px; | ||||
| } | ||||
| @@ -0,0 +1,17 @@ | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||||
| import { UserLoginPage } from './user-login.page'; | ||||
|  | ||||
| describe('UserLoginPage', () => { | ||||
|   let component: UserLoginPage; | ||||
|   let fixture: ComponentFixture<UserLoginPage>; | ||||
|  | ||||
|   beforeEach(() => { | ||||
|     fixture = TestBed.createComponent(UserLoginPage); | ||||
|     component = fixture.componentInstance; | ||||
|     fixture.detectChanges(); | ||||
|   }); | ||||
|  | ||||
|   it('should create', () => { | ||||
|     expect(component).toBeTruthy(); | ||||
|   }); | ||||
| }); | ||||
| @@ -0,0 +1,18 @@ | ||||
| import { Component, OnInit } from '@angular/core'; | ||||
| import { UserService } from 'src/app/services/user.service'; | ||||
|  | ||||
| @Component({ | ||||
|   selector: 'app-user-login', | ||||
|   templateUrl: './user-login.page.html', | ||||
|   styleUrls: ['./user-login.page.scss'], | ||||
|   standalone: false, | ||||
| }) | ||||
| export class UserLoginPage implements OnInit { | ||||
|  | ||||
|   constructor(private userService: UserService) { } | ||||
|  | ||||
|   ngOnInit() { | ||||
|     this.userService.getUserList().subscribe(users => console.log('Users: ', users)); | ||||
|   } | ||||
|  | ||||
| } | ||||
		Reference in New Issue
	
	Block a user