Guest User

Untitled

a guest
Nov 16th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. import { NgModule } from '@angular/core';
  2. import { CommonModule } from '@angular/common';
  3. import { WellsComponent } from './wells.component';
  4. import { SharedModule } from 'src/app/shared/shared.module';
  5.  
  6. export const WELL_ROUTES: Routes = [
  7. { data : { label: 'Overview' }, path: '', component: OverviewComponent },
  8. { data : { label: 'Status' }, path: ':wellId/status', component: StatusComponent },
  9. { data : { label: 'Alarm Settings' }, path: ':wellId/alarm-settings', component: AlarmSettingsComponent },
  10. { data : { label: 'Down Hole Gauge' }, path: ':wellId/down-hole-gauge', component: DownHoleGaugeComponent },
  11. { data : { label: 'Gas Injection' }, path: ':wellId/gas-injection', component: GasInjectionComponent },
  12. { data : { label: 'Pressure Overrides' }, path: ':wellId/pressure-overrides', component: PressureOverridesComponent },
  13. { data : { label: 'Location' }, path: ':wellId/location', component: LocationComponent }
  14. ];
  15.  
  16. @NgModule({
  17. imports: [
  18. SharedModule
  19. ],
  20. declarations: [
  21. WellsComponent
  22. ],
  23. exports: [
  24. WellsComponent
  25. ]
  26. })
  27. export class WellsModule {}
  28.  
  29. import { Component, OnInit, Input } from '@angular/core';
  30. import { WELL_ROUTES } from './wells.module';
  31.  
  32. @Component({
  33. selector: 'app-wells',
  34. templateUrl: './wells.component.html',
  35. styleUrls: ['./wells.component.scss']
  36. })
  37. export class WellsComponent implements OnInit {
  38. @Input() navLinks: any[] = [];
  39.  
  40. constructor() {
  41. const navLinks: any[] = [];
  42. WELL_ROUTES.forEach((item, idx) => {
  43. if (item.path) {
  44. const label: string = item.data.label;
  45. const link: string = item.path;
  46. navLinks.push({ label: label, link: link });
  47. }
  48. });
  49. this.navLinks = navLinks;
  50. }
  51.  
  52. ngOnInit() {}
  53. }
  54.  
  55.  
  56. Error:
  57. Unexpected value 'undefined' exported by the module 'WellsModule'
Add Comment
Please, Sign In to add comment