thingsboard 新增一个测试菜单页面 |
您所在的位置:网站首页 › thingsboard二次开发 › thingsboard 新增一个测试菜单页面 |
1、在src>app>core>services>menu.service.ts 中写: { id: guid(), name: '测试菜单', type: 'link', path: '/npages', icon: 'badge' }, { name: '测试菜单', places: [ { name: '测试菜单', icon: 'view_quilt', path: '/npages', }, ] },2、cd进入 src>app>modules>home>pages 中写: 创建一个带有路由的文件 ng g module npages --routing 创建基础文件 ng g component npages 3、在src>app>modules>home>pages>npages >npages-routing.module.ts 中写: import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import {Authority} from '@shared/models/authority.enum'; import {DevicesTableConfigResolver} from '@home/pages/device/devices-table-config.resolver'; import {NpagesComponent} from '@home/pages/npages/npages.component'; const routes: Routes = [ { path: 'npages', data: { breadcrumb: { label: '测试菜单', icon: 'devices_other' } }, children: [ { path: '', component: NpagesComponent, data: { auth: [Authority.TENANT_ADMIN, Authority.CUSTOMER_USER], title: '测试菜单', devicesType: 'tenant' }, resolve: { entitiesTableConfig: DevicesTableConfigResolver } }, ] } ]; @NgModule({ imports: [RouterModule.forChild(routes)], exports: [RouterModule] }) export class NpagesRoutingModule { } |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |