title: Define global variable with Typescript Angularjs in components
body: <p>My application uses components and boostrapper. I want to create a datepicker which will set a global date variable. I have tried to create a service, use the rootscope and basically all the solutions I could find on stackoverflow but it doesn't seem to work.</p>
  
  <p>What would be the correct approach to create a global variable shared across all components?</p>