title: Detect if page if component is loaded first time angular 6
body: <p>Hi is there any way to detect whether component is loaded first time in angular 6
  I want to run a function call only is the component is loaded for the first time else show the old variable data</p>