| import { NgModule } from '@angular/core'; | import { NgModule } from '@angular/core'; | ||||
| import { BrowserModule } from '@angular/platform-browser'; | |||||
| import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; | |||||
| import { Routes, RouterModule } from '@angular/router'; | import { Routes, RouterModule } from '@angular/router'; | ||||
| import { DashboardComponent } from './dashboard/dashboard.component'; | |||||
| const routes: Routes = []; | |||||
| const routes: Routes = [ | |||||
| {path : '', component: DashboardComponent}, | |||||
| {path : 'dashboard', component: DashboardComponent} | |||||
| ]; | |||||
| @NgModule({ | @NgModule({ | ||||
| imports: [RouterModule.forRoot(routes)], | imports: [RouterModule.forRoot(routes)], |
| <kendo-contextmenu [target]="target" [items]="items"> </kendo-contextmenu> | |||||
| <div class=topMenuBar > | |||||
| <kendo-menu [items]="items"> </kendo-menu> | |||||
| </div> | |||||
| <router-outlet></router-outlet> | |||||
| <div #target class="target"> | <div #target class="target"> | ||||
| <p class="placeholder">Right-click to open Context menu</p> | <p class="placeholder">Right-click to open Context menu</p> | ||||
| </div> | </div> | ||||
| <kendo-contextmenu [target]="target" [items]="items"> </kendo-contextmenu> | |||||
| <kendo-menu [items]="items"> </kendo-menu> |
| border-radius: 5px; | border-radius: 5px; | ||||
| height: 100px; | height: 100px; | ||||
| width: 400px; | width: 400px; | ||||
| background-color: #f6f6f6; | |||||
| background-color: yellowgreen; | |||||
| display: flex; | display: flex; | ||||
| justify-content: center; | justify-content: center; | ||||
| align-items: center; | align-items: center; | ||||
| font-size: 20px; | font-size: 20px; | ||||
| color: #656565; | color: #656565; | ||||
| margin: 0; | margin: 0; | ||||
| } | |||||
| .topMenuBar { | |||||
| left: 0px; | |||||
| top: 0px; | |||||
| // position: absolute; | |||||
| margin : 0px; | |||||
| width : 100%; | |||||
| display: block; | |||||
| background-color: rgb(229, 230, 218); | |||||
| box-shadow : 0px 0px 2px 0px #d6d2d2 | |||||
| } | } |
| //App | //App | ||||
| import { AppComponent } from './app.component'; | import { AppComponent } from './app.component'; | ||||
| import { AppRoutingModule } from './app-routing.module'; | import { AppRoutingModule } from './app-routing.module'; | ||||
| import { DashboardComponent } from './dashboard/dashboard.component'; | |||||
| @NgModule({ | @NgModule({ | ||||
| declarations: [ | declarations: [ | ||||
| AppComponent | |||||
| AppComponent, | |||||
| DashboardComponent | |||||
| ], | ], | ||||
| imports: [ | imports: [ | ||||
| BrowserModule, | BrowserModule, |
| <p>dashboard works!</p> |
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | |||||
| import { DashboardComponent } from './dashboard.component'; | |||||
| describe('DashboardComponent', () => { | |||||
| let component: DashboardComponent; | |||||
| let fixture: ComponentFixture<DashboardComponent>; | |||||
| beforeEach(async () => { | |||||
| await TestBed.configureTestingModule({ | |||||
| declarations: [ DashboardComponent ] | |||||
| }) | |||||
| .compileComponents(); | |||||
| }); | |||||
| beforeEach(() => { | |||||
| fixture = TestBed.createComponent(DashboardComponent); | |||||
| component = fixture.componentInstance; | |||||
| fixture.detectChanges(); | |||||
| }); | |||||
| it('should create', () => { | |||||
| expect(component).toBeTruthy(); | |||||
| }); | |||||
| }); |
| import { Component, OnInit } from '@angular/core'; | |||||
| @Component({ | |||||
| selector: 'app-dashboard', | |||||
| templateUrl: './dashboard.component.html', | |||||
| styleUrls: ['./dashboard.component.scss'] | |||||
| }) | |||||
| export class DashboardComponent implements OnInit { | |||||
| constructor() { } | |||||
| ngOnInit(): void { | |||||
| } | |||||
| } |
| exports.AppRoutingModule = void 0; | exports.AppRoutingModule = void 0; | ||||
| var core_1 = require("@angular/core"); | var core_1 = require("@angular/core"); | ||||
| var router_1 = require("@angular/router"); | var router_1 = require("@angular/router"); | ||||
| var routes = []; | |||||
| var dashboard_component_1 = require("./dashboard/dashboard.component"); | |||||
| var routes = [ | |||||
| { path: '', component: dashboard_component_1.DashboardComponent }, | |||||
| { path: 'dashboard', component: dashboard_component_1.DashboardComponent } | |||||
| ]; | |||||
| var AppRoutingModule = /** @class */ (function () { | var AppRoutingModule = /** @class */ (function () { | ||||
| function AppRoutingModule() { | function AppRoutingModule() { | ||||
| } | } |
| border-radius: 5px; | border-radius: 5px; | ||||
| height: 100px; | height: 100px; | ||||
| width: 400px; | width: 400px; | ||||
| background-color: #f6f6f6; | |||||
| background-color: yellowgreen; | |||||
| display: flex; | display: flex; | ||||
| justify-content: center; | justify-content: center; | ||||
| align-items: center; | align-items: center; | ||||
| font-size: 20px; | font-size: 20px; | ||||
| color: #656565; | color: #656565; | ||||
| margin: 0; | margin: 0; | ||||
| } | |||||
| .topMenuBar { | |||||
| left: 0px; | |||||
| top: 0px; | |||||
| margin: 0px; | |||||
| width: 100%; | |||||
| display: block; | |||||
| background-color: #e5e6da; | |||||
| box-shadow: 0px 0px 2px 0px #d6d2d2; | |||||
| } | } |
| exports.mainMenuItems = [ | exports.mainMenuItems = [ | ||||
| { | { | ||||
| text: 'Item1a中文', | text: 'Item1a中文', | ||||
| items: [{ text: 'Item1.1' }, { text: 'Item1.2', items: [{ text: 'Item1.2.1' }, { text: 'Item1.2.2' }] }] | |||||
| items: [{ text: 'Item1.1', url: '/dashboard' }, { text: 'Item1.2', items: [{ text: 'Item1.2.1' }, { text: 'Item1.2.2' }] }] | |||||
| }, | }, | ||||
| { | { | ||||
| text: 'Item2', | text: 'Item2', | ||||
| items: [{ text: 'Item2.1' }, { text: 'Item2.2' }, { text: 'Item2.3' }] | |||||
| items: [{ text: 'Item2.1', url: 'https://google.com.au' }, { text: 'Item2.2' }, { text: 'Item2.3' }] | |||||
| }, | }, | ||||
| { | { | ||||
| text: 'Item3' | text: 'Item3' |
| export const mainMenuItems: any[] = [ | export const mainMenuItems: any[] = [ | ||||
| { | { | ||||
| text: 'Item1a中文', | text: 'Item1a中文', | ||||
| items: [{ text: 'Item1.1' }, { text: 'Item1.2', items: [{ text: 'Item1.2.1' }, { text: 'Item1.2.2' }] }] | |||||
| items: [{ text: 'Item1.1', url: '/dashboard'}, { text: 'Item1.2', items: [{ text: 'Item1.2.1' }, { text: 'Item1.2.2' }] }] | |||||
| }, | }, | ||||
| { | { | ||||
| text: 'Item2', | text: 'Item2', | ||||
| items: [{ text: 'Item2.1' }, { text: 'Item2.2' }, { text: 'Item2.3' }] | |||||
| items: [{ text: 'Item2.1', url: 'https://google.com.au' }, { text: 'Item2.2' }, { text: 'Item2.3' }] | |||||
| }, | }, | ||||
| { | { | ||||
| text: 'Item3' | text: 'Item3' |