{"ast":null,"code":"import { NavigationEnd } from '@angular/router';\nimport { filter } from 'rxjs/operators';\nimport * as i0 from \"@angular/core\";\nimport * as i1 from \"@angular/router\";\nimport * as i2 from \"@angular/platform-browser\";\nimport * as i3 from \"./base/header/header.component\";\nimport * as i4 from \"./base/pagedetails/pagedetails.component\";\nimport * as i5 from \"./base/bottomslider/bottomslider.component\";\nimport * as i6 from \"./base/footer/footer.component\";\nexport let AppComponent = /*#__PURE__*/(() => {\n  class AppComponent {\n    constructor(router, activatedRoute, titleService) {\n      this.router = router;\n      this.activatedRoute = activatedRoute;\n      this.titleService = titleService;\n    }\n\n    ngOnInit() {\n      this.router.events.pipe(filter(event => event instanceof NavigationEnd)).subscribe(() => {\n        const rt = this.getChild(this.activatedRoute);\n        rt.data.subscribe(data => {\n          this.titleService.setTitle(data.title);\n        });\n      });\n    }\n\n    getChild(activatedRoute) {\n      if (activatedRoute.firstChild) {\n        return this.getChild(activatedRoute.firstChild);\n      } else {\n        return activatedRoute;\n      }\n    }\n\n  }\n\n  AppComponent.ɵfac = function AppComponent_Factory(t) {\n    return new (t || AppComponent)(i0.ɵɵdirectiveInject(i1.Router), i0.ɵɵdirectiveInject(i1.ActivatedRoute), i0.ɵɵdirectiveInject(i2.Title));\n  };\n\n  AppComponent.ɵcmp = /*@__PURE__*/i0.ɵɵdefineComponent({\n    type: AppComponent,\n    selectors: [[\"app-root\"]],\n    decls: 6,\n    vars: 0,\n    consts: [[1, \"page\"]],\n    template: function AppComponent_Template(rf, ctx) {\n      if (rf & 1) {\n        i0.ɵɵelementStart(0, \"div\", 0);\n        i0.ɵɵelement(1, \"app-header\");\n        i0.ɵɵelement(2, \"app-pagedetails\");\n        i0.ɵɵelement(3, \"router-outlet\");\n        i0.ɵɵelement(4, \"app-bottomslider\");\n        i0.ɵɵelement(5, \"app-footer\");\n        i0.ɵɵelementEnd();\n      }\n    },\n    directives: [i3.HeaderComponent, i4.PagedetailsComponent, i1.RouterOutlet, i5.BottomsliderComponent, i6.FooterComponent],\n    styles: [\"\"]\n  });\n  return AppComponent;\n})();","map":null,"metadata":{},"sourceType":"module"}