| import { NgModule } from '@angular/core'; | import { NgModule } from '@angular/core'; | ||||
| import { Routes, RouterModule } from '@angular/router'; | import { Routes, RouterModule } from '@angular/router'; | ||||
| import { AuthComponent } from './auth/auth.component'; | import { AuthComponent } from './auth/auth.component'; | ||||
| import { CanvasComponent } from './canvas/canvas.component'; | |||||
| import { DashboardComponent } from './dashboard/dashboard.component'; | import { DashboardComponent } from './dashboard/dashboard.component'; | ||||
| import { AuthGuard } from './service/auth-guard.service'; | import { AuthGuard } from './service/auth-guard.service'; | ||||
| import { TransactionListComponent } from './transaction-list/transaction-list.component'; | import { TransactionListComponent } from './transaction-list/transaction-list.component'; | ||||
| const routes: Routes = [ | const routes: Routes = [ | ||||
| {path : '', component: DashboardComponent, canActivate: [AuthGuard]}, | {path : '', component: DashboardComponent, canActivate: [AuthGuard]}, | ||||
| {path : 'canvas', component: CanvasComponent}, | |||||
| {path : 'dashboard', component: DashboardComponent, canActivate: [AuthGuard] }, | {path : 'dashboard', component: DashboardComponent, canActivate: [AuthGuard] }, | ||||
| {path : 'login', component: AuthComponent}, | {path : 'login', component: AuthComponent}, | ||||
| {path : 'transaction', component: TransactionComponent, canActivate: [AuthGuard]}, | {path : 'transaction', component: TransactionComponent, canActivate: [AuthGuard]}, |
| import { DashboardComponent } from './dashboard/dashboard.component'; | import { DashboardComponent } from './dashboard/dashboard.component'; | ||||
| import { AuthComponent } from './auth/auth.component'; | import { AuthComponent } from './auth/auth.component'; | ||||
| import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; | import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; | ||||
| import { CanvasComponent } from './canvas/canvas.component'; | |||||
| import { MenuService } from './service/menu.service'; | import { MenuService } from './service/menu.service'; | ||||
| import { LoanEditComponent } from './loan-edit/loan-edit.component'; | import { LoanEditComponent } from './loan-edit/loan-edit.component'; | ||||
| import { NavigationModule } from '@progress/kendo-angular-navigation'; | import { NavigationModule } from '@progress/kendo-angular-navigation'; | ||||
| AppComponent, | AppComponent, | ||||
| DashboardComponent, | DashboardComponent, | ||||
| AuthComponent, | AuthComponent, | ||||
| CanvasComponent, | |||||
| LoanEditComponent, | LoanEditComponent, | ||||
| BkpDividerComponent, | BkpDividerComponent, | ||||
| BkpDividerShadowBottomComponent, | BkpDividerShadowBottomComponent, |
| <p>this is canvas</p> |
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | |||||
| import { CanvasComponent } from './canvas.component'; | |||||
| describe('CanvasComponent', () => { | |||||
| let component: CanvasComponent; | |||||
| let fixture: ComponentFixture<CanvasComponent>; | |||||
| beforeEach(async () => { | |||||
| await TestBed.configureTestingModule({ | |||||
| declarations: [ CanvasComponent ] | |||||
| }) | |||||
| .compileComponents(); | |||||
| }); | |||||
| beforeEach(() => { | |||||
| fixture = TestBed.createComponent(CanvasComponent); | |||||
| component = fixture.componentInstance; | |||||
| fixture.detectChanges(); | |||||
| }); | |||||
| it('should create', () => { | |||||
| expect(component).toBeTruthy(); | |||||
| }); | |||||
| }); |
| import { Component, OnDestroy, OnInit } from '@angular/core'; | |||||
| import {Observable, Subscription} from 'rxjs'; | |||||
| import { sampleProducts } from '../models/sample_product'; | |||||
| import { MenuService } from '../service/menu.service'; | |||||
| import {AuthService} from '../service/auth.service'; | |||||
| import {HttpClient} from '@angular/common/http'; | |||||
| import {setTime} from '@progress/kendo-angular-dateinputs/dist/es2015/util'; | |||||
| @Component({ | |||||
| selector: 'app-canvas', | |||||
| templateUrl: './canvas.component.html', | |||||
| styleUrls: ['./canvas.component.scss'] | |||||
| }) | |||||
| export class CanvasComponent implements OnInit, OnDestroy { | |||||
| public gridData: any[] = sampleProducts; | |||||
| private menutItemSub: Subscription; | |||||
| constructor(private menuService: MenuService, private http: HttpClient) { } | |||||
| ngOnInit(): void { | |||||
| this.menutItemSub = this.menuService.itemClicked.subscribe( | |||||
| (item:any) =>{ | |||||
| console.log(item); | |||||
| } | |||||
| ); | |||||
| } | |||||
| ngOnDestroy(): void{ | |||||
| this.menutItemSub.unsubscribe(); | |||||
| } | |||||
| } |
| "use strict"; | |||||
| var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | |||||
| var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | |||||
| if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | |||||
| else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | |||||
| return c > 3 && r && Object.defineProperty(target, key, r), r; | |||||
| }; | |||||
| exports.__esModule = true; | |||||
| exports.CanvasComponent = void 0; | |||||
| var core_1 = require("@angular/core"); | |||||
| var sample_product_1 = require("../models/sample_product"); | |||||
| var CanvasComponent = /** @class */ (function () { | |||||
| function CanvasComponent(menuService) { | |||||
| this.menuService = menuService; | |||||
| this.gridData = sample_product_1.sampleProducts; | |||||
| } | |||||
| CanvasComponent.prototype.ngOnInit = function () { | |||||
| this.menutItemSub = this.menuService.itemClicked.subscribe(function (item) { | |||||
| console.log(item); | |||||
| }); | |||||
| }; | |||||
| CanvasComponent.prototype.ngOnDestroy = function () { | |||||
| this.menutItemSub.unsubscribe(); | |||||
| }; | |||||
| CanvasComponent = __decorate([ | |||||
| core_1.Component({ | |||||
| selector: 'app-canvas', | |||||
| templateUrl: './canvas.component.html', | |||||
| styleUrls: ['./canvas.component.scss'] | |||||
| }) | |||||
| ], CanvasComponent); | |||||
| return CanvasComponent; | |||||
| }()); | |||||
| exports.CanvasComponent = CanvasComponent; |
| { | { | ||||
| text: '', | text: '', | ||||
| fa: faUniversity, | fa: faUniversity, | ||||
| url: './#canvas' | |||||
| }, | }, | ||||
| { | { | ||||
| text: 'SFM', | text: 'SFM', | ||||
| { | { | ||||
| text: 'people', | text: 'people', | ||||
| fa: faUniversity, | fa: faUniversity, | ||||
| url: './#canvas' | |||||
| }, | }, | ||||
| ]; | ]; |