How to get data in routing by Angular6

make the following settings within the route

{
    path: "setting",
    loadChildren: "./setting/setting.module-sharpSettingModule",
    data: { title: "", depth: 2 }
  },
  {
    path: "feedback",
    loadChildren: "./feedback/feedback.module-sharpFeedbackModule",
    data: { title: "", depth: 2 }
  }

get the title in data in AppModule and set

currently, I just can"t get this data, solution

.
Feb.06,2022

get


only use the data in the route to animate the transition. If you want to get the value of data, you can subscribe to ActivatedRoute.data
such as
this.activatedRoute.data.subscribe (res = > console.log (res))
or
const data= this.activatedRoute.snapshot.data

) within the component.
Menu